Geospatial Information Evaluation with Geemap – KDnuggets


Illustration by Writer

 

Geospatial knowledge evaluation is a discipline addressed to take care of, 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 a further column, the situation data, similar to latitude and longitude. 

There are two foremost varieties 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 pictures, similar to satellite tv for pc pictures and aerial images. 

On this article, I’m going to give attention to 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 could 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. Dwelling 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 educational, non-profit and enterprise functions.

 

Geospatial Data Analysis with Geemap
Screenshot by Writer. Overview of Earth Engine Information 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’ll be able to 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 permits to investigate and visualize big quantities of geospatial knowledge from Google Earth Engine. 

Earlier than this package deal, it was already attainable to make computational requests by means of 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 wonderful package deal in Google Colab to grasp its full potential. Check out this free e-book written by professor Dr. Qiusheng Wu for getting began with Geemap and Google Earth Engine.

 

The best way to Entry Earth Engine?

 

First, we have to import two Python libraries, that might 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 could be utilized for the authentication on Earth Engine, however it may be sooner by utilizing instantly the Geemap library:

 

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

 

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

 

After, it can ask you to decide on the account. I like to recommend taking the identical account of Google Colab if you’re utilizing it.

 

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

 

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

 

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

 

After this motion, the authentication code is generated and you’ll 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’ll be able to 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 methods to authenticate and visualize an interactive map utilizing a single line of code. Now, we will 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 give attention to 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 attainable methods. The primary means consists of writing and operating the next code line:

m.add_basemap("ROADMAP")
m

 

Geospatial Data Analysis with Geemap

 

Alternatively, you’ll be able to 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 record 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’ll be able to discover, there’s a lengthy collection of base maps, most of them accessible because of OpenStreetMap, ESRI and USGS.

 

Earth Engine Information Sorts

 

Earlier than exhibiting the total potential of Geemap, it’s necessary to know two foremost 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, Characteristic 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 foremost varieties of geometries are supported by Earth Engine: Level, LineString and Polygon.
  • Characteristic 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 comprises 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 exhibits the Australian Smoothed Digital Elevation Mannequin (DEM-S)

 

On this planet of raster knowledge, we give attention to Picture objects. Google Earth Engine’s Photos are composed of a number of manufacturers, the place every band has a particular identify, estimated minimal and most, and outline.

If we have now a set or time collection of pictures, 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 will 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 comparable, 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 necessary contributors to the greenhouse impact, is distributed throughout the globe. 

 

Last Ideas

 

This was an introductory information that may make it easier to work with Google Earth Engine knowledge utilizing Python. Geemap is probably the most full Python library to visualise and analyze any such knowledge. 

If you wish to go deeper into this package deal, you’ll be able to check out the assets I instructed beneath. 

The code could 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 Info Engineering of the College of Padova, Italy. Her analysis venture is targeted on Continuous Studying mixed with Anomaly Detection.

Recent articles

Hackers Use Microsoft MSC Information to Deploy Obfuscated Backdoor in Pakistan Assaults

Dec 17, 2024Ravie LakshmananCyber Assault / Malware A brand new...

INTERPOL Pushes for

Dec 18, 2024Ravie LakshmananCyber Fraud / Social engineering INTERPOL is...

Patch Alert: Essential Apache Struts Flaw Discovered, Exploitation Makes an attempt Detected

Dec 18, 2024Ravie LakshmananCyber Assault / Vulnerability Risk actors are...

LEAVE A REPLY

Please enter your comment!
Please enter your name here