Geospatial Knowledge Evaluation with Geemap

Date:

Share post:


Illustration by Writer

 

Geospatial knowledge evaluation is a subject addressed to cope with, visualize and analyze a particular kind of information, referred to as geospatial knowledge. In comparison with the traditional knowledge, we have now tabular knowledge with an extra column, the placement info, corresponding to latitude and longitude. 

There are two major kinds of knowledge: vector knowledge and raster knowledge. When coping with vector knowledge, you continue to have a tabular dataset, whereas raster knowledge are extra much like photographs, corresponding to satellite tv for pc photographs and aerial pictures. 

On this article, I’m going to concentrate on raster knowledge offered by Google Earth Engine, a cloud computing platform that gives an enormous knowledge catalog of satellite tv for pc imagery. This sort of knowledge might be simply mastered out of your Jupyter Pocket book utilizing a life-saving Python package deal, referred to as Geemap. Let’s get began!

 

What’s Google Earth Engine?

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Residence web page of Google Earth Engine.

 

Earlier than getting began with the Python Library, we have to perceive the potential of Google Earth Engine. This cloud-based platform, powered by Google Cloud platform, hosts public and free geospatial datasets for tutorial, non-profit and enterprise functions.

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Overview of Earth Engine Knowledge Catalog. 

 

The great thing about this platform is that it gives a multi-petabyte catalog of raster and vector knowledge, saved on the Earth Engine servers. You possibly can have a quick overview from this hyperlink. Furthermore, it gives APIs to facilitate the evaluation of raster datasets. 

 

What’s Geemap?

 

Geospatial Data Analysis with Geemap
Illustration by Writer. Geemap library.

 

Geemap is a Python library that enables to research and visualize big quantities of geospatial knowledge from Google Earth Engine. 

Earlier than this package deal, it was already potential to make computational requests by JavaScript and Python APIs, however Python APIs had restricted functionalities and lacked documentation. 

To fill this hole, Geemap was created to allow customers to entry assets of Google Earth Engine with few traces of code. Geemap is constructed upon eartengine-api, ipyleaflet and folium.

To put in the library, you simply want the next command:

 

I like to recommend you experiment with this superb package deal in Google Colab to know its full potential. Check out this free guide written by professor Dr. Qiusheng Wu for getting began with Geemap and Google Earth Engine.

 

The way to Entry Earth Engine?

 

First, we have to import two Python libraries, that shall be used throughout the tutorial:

 

Along with geemap, we have now imported the Earth Engine Python consumer library, referred to as ee. 

This Python library might be utilized for the authentication on Earth Engine, however it may be quicker by utilizing immediately the Geemap library:

 

You might want to click on the URL returned by this line of code, which can generate the authorization code. First, choose the cloud mission and, then, click on the “GENERATE TOKEN” button.

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Pocket book Authenticator.

 

After, it is going to ask you to decide on the account. I like to recommend taking the identical account of Google Colab in case you are utilizing it.

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Select an account.

 

Then, click on the test field subsequent to Choose All and press the “Continue” button. In a nutshell, this step permits the Pocket book Shopper to entry the Earth Engine account.

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Permit the Pocket book Shopper to entry your Earth Engine account.

 

After this motion, the authentication code is generated and you may paste it into the pocket book cell.

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Copy the Authentication Code.

 

As soon as the verification code is entered, you may lastly create and visualize this interactive map:

 

Geospatial Data Analysis with Geemap

 

For now, you’re simply observing the bottom map on high of ipyleaflet, a Python package deal that allows the visualization of interactive maps throughout the Jupyter Pocket book. 

 

Create Interactive Maps

 

Beforehand, we have now seen the way to authenticate and visualize an interactive map utilizing a single line of code. Now, we are able to customise the default map by specifying the latitude and longitude of the centroid, the extent of zoom and the peak. I’ve chosen the coordinates of Rome for the centre to concentrate on the map of Europe. 

m = geemap.Map(heart=[41, 12], zoom=6, peak=600)
m

 

Geospatial Data Analysis with Geemap

 

If we wish to change the bottom map, there are two potential methods. The primary method consists of writing and operating the next code line:

m.add_basemap("ROADMAP")
m

 

Geospatial Data Analysis with Geemap

 

Alternatively, you may change manually the bottom map by clicking the icon of ring spanner positioned on the proper. 

 

Geospatial Data Analysis with Geemap

 

Furthermore, we see the listing of base maps offered by Geemap:

basemaps = geemap.basemaps.keys()
for bm in basemaps:
   print(bm)

 

That is the output:

OpenStreetMap
Esri.WorldStreetMap
Esri.WorldImagery
Esri.WorldTopoMap
FWS NWI Wetlands
FWS NWI Wetlands Raster
NLCD 2021 CONUS Land Cowl
NLCD 2019 CONUS Land Cowl
...

 

As you may discover, there’s a lengthy collection of base maps, most of them out there because of OpenStreetMap, ESRI and USGS.

 

Earth Engine Knowledge Sorts

 

Earlier than exhibiting the total potential of Geemap, it’s essential to know two major knowledge varieties in Earth Engine. Check out the Google Earth Engine’s documentation for extra particulars.

 

Geospatial Data Analysis with Geemap
Illustration by Writer. Instance of vector knowledge varieties: Geometry, Function and FeatureCollection.

 

When dealing with vector knowledge, we use principally three knowledge varieties:

  • Geometry shops the coordinates wanted to attract the vector knowledge on a map. Three major kinds of geometries are supported by Earth Engine: Level, LineString and Polygon.
  • Function is basically a row that mixes geometry and non-geographical attributes. It’s similar to the GeoSeries class of GeoPandas.
  • FeatureCollection is a tabular knowledge construction that incorporates a set of options. FeatureCollection and GeoDataFrame are virtually similar conceptually.

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Instance of Picture knowledge kind. It reveals the Australian Smoothed Digital Elevation Mannequin (DEM-S)

 

On the earth of raster knowledge, we concentrate on Picture objects. Google Earth Engine’s Pictures are composed of a number of manufacturers, the place every band has a selected identify, estimated minimal and most, and outline.

If we have now a set or time collection of photographs, ImageCollection is extra acceptable as an information kind.

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Copernicus CORINE Land Cowl.

 

We visualize the satellite tv for pc imagery exhibiting the land cowl map of Europe. This dataset gives the adjustments between 1986 and 2018.

First, we load the picture utilizing ee.Picture and, then, choose the band “landcover”. Lastly, let’s visualize the picture by including the loaded dataset to the map as a layer utilizing Map.addLayer. 

Map = geemap.Map()
dataset = ee.Picture('COPERNICUS/CORINE/V20/100m/2012')
landCover = dataset.choose('landcover')
Map.setCenter(16.436, 39.825, 6)
Map.addLayer(landCover, {}, 'Land Cowl')
Map

 

Geospatial Data Analysis with Geemap
Screenshot by Writer.

 

Equally, we are able to do the identical factor to load and visualize the satellite tv for pc imagery exhibiting the land cowl map of Europe. This dataset gives the adjustments between 1986 and 2018.

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Offline high-resolution imagery of methane concentrations.

 

To visualise an Earth Engine ImageCollection, the traces of code are related, apart from ee.ImageCollection. 

Map = geemap.Map()
assortment = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_CH4').choose('CH4_column_volume_mixing_ratio_dry_air').filterDate('2019-06-01', '2019-07-16')
band_viz = {
 'min': 1750,
 'max': 1900,
 'palette': ['black', 'blue', 'purple', 'cyan', 'green', 'yellow', 'red']
}

Map.addLayer(assortment.imply(), band_viz, 'S5P CH4')
Map.setCenter(0.0, 0.0, 2)
Map

 

Geospatial Data Analysis with Geemap
Screenshot by Writer.

 

That’s nice! From this map, we discover how Methane, one of the crucial essential contributors to the greenhouse impact, is distributed throughout the globe. 

 

Ultimate Ideas

 

This was an introductory information that may assist you to work with Google Earth Engine knowledge utilizing Python. Geemap is essentially the most full Python library to visualise and analyze one of these knowledge. 

If you wish to go deeper into this package deal, you may check out the assets I instructed beneath. 

The code might be discovered right here. I hope you discovered the article helpful. Have a pleasant day!

Helpful assets:

 
 

Eugenia Anello is at the moment a analysis fellow on the Division of Data Engineering of the College of Padova, Italy. Her analysis mission is concentrated on Continuous Studying mixed with Anomaly Detection.

Related articles

Ubitium Secures $3.7M to Revolutionize Computing with Common RISC-V Processor

Ubitium, a semiconductor startup, has unveiled a groundbreaking common processor that guarantees to redefine how computing workloads are...

Archana Joshi, Head – Technique (BFS and EnterpriseAI), LTIMindtree – Interview Collection

Archana Joshi brings over 24 years of expertise within the IT companies {industry}, with experience in AI (together...

Drasi by Microsoft: A New Strategy to Monitoring Fast Information Adjustments

Think about managing a monetary portfolio the place each millisecond counts. A split-second delay may imply a missed...

RAG Evolution – A Primer to Agentic RAG

What's RAG (Retrieval-Augmented Era)?Retrieval-Augmented Era (RAG) is a method that mixes the strengths of enormous language fashions (LLMs)...