You are on page 1of 42

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/344178143

Introduction to geemap and the Earth Engine


Python API

Presentation · September 2020


DOI: 10.13140/RG.2.2.29054.20806

CITATIONS READS

0 1,243

1 author:

Qiusheng Wu
University of Tennessee
79 PUBLICATIONS   1,821 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

WhiteboxTools Frontends View project

Localization of geographical analyses View project

All content following this page was uploaded by Qiusheng Wu on 09 September 2020.

The user has requested enhancement of the downloaded file.


Introduction to geemap
A Python package for interactive mapping with Google Earth Engine

Qiusheng Wu, PhD


Department of Geography
University of Tennessee, Knoxville
https://wetlands.io
@giswqs

Earth Engine Virtual Meetup


September 9, 2020 https://gishub.org/meetup

slides
Try it out

Outline
● Motivation
● Introducing geemap
● Documentation
● Tutorials
● Key Features
● Q&A

2
Motivation

3
Google Earth vs. Earth Engine
● Google Earth
○ Google Earth enables you to travel and learn about the world through a virtual globe. You can
view satellite imagery, maps, terrain, 3D buildings and much more.
● Earth Engine
○ Earth Engine, on the other hand, is a tool for analyzing geospatial information.
○ Although Earth Engine has a data catalog, not everything available in Google Earth is
available for analysis in the Earth Engine catalog. Similarly, much of the data in Earth Engine is
not currently available for visualization in Google Earth.

Image Viewer Photoshop

vs.

https://google.com/earth https://earthengine.google.com 4
What is Earth Engine?
https://earthengine.google.com/

5
Before Earth Engine
Google Earth Engine

6
After Earth
Before EarthEngine
Engine
Google Earth Engine

7
Earth Engine Data Catalog
https://developers.google.com/earth-engine/datasets/

Landsat & Sentinel MODIS Vector Data Terrain & Weather & Climate
10-30m, weekly 250m daily WDPA, TIGER, WHC Land Cover NOAA NCEP, OMI, ...

... and upload your own vectors and


rasters
600+ public datasets 30+ petabytes of data
100+ datasets added yearly 1+ PB of new data every month
8
Credits to Michael DeWitt
Earth Engine JavaScript Code Editor
https://code.earthengine.google.com/

Landsat NDWI example 9


Earth Engine JavaScript API vs. Python API
Earth Engine JavaScript Code Editor Earth Engine Python API

● Rich documentation and tutorials ● Limited documentation and tutorials


● Easy to get started ● Easier language syntax
● Built-in interactive mapping functionality ● Easy to share code between scripts
● Built-in authentication ● Batch processing (e.g., exporting images)
● Earth Engine Apps ● More IDEs with debugging capability
● Can’t install additional package ● Numerous Python packages
● Many plotting and visualization options
● Integration with open-source GIS
● Accessing data stored locally
● Deep learning

10
Earth Engine JavaScript API vs. Python API

11
Introducing geemap

12
Introducing geemap
● A Python package for interactive mapping ● Key dependencies:
with Google Earth Engine, ipyleaflet, and ○ earthengine-api
ipywidgets. ○ ipyleaflet
○ folium
● GitHub: https://github.com/giswqs/geemap
○ ipywidgets
○ bqplot
○ voila

13
Installing geemap
● PyPI
○ pip install geemap
● conda-forge (recommended)
○ conda create -n gee python
○ conda activate gee
○ conda install mamba -c conda-forge
○ mamba install geemap -c conda-forge
● GitHub
○ pip install git+https://github.com/giswqs/geemap
● How to update geemap?
○ pip install -U geemap
○ conda update geemap -c conda-forge
○ geemap.update_package()
14
Docker image https://github.com/gee-community/ee-jupyter-contrib

15
Using geemap
Google Colab JupyterLab / Jupyter notebook
● No local setup needed ● Required local setup
● Requires geemap installation and ee ● Requires geemap installation and ee
authentication every time authentication one time only
● Uses folium plotting backend ● Uses ipyleaflet plotting backend
● Limited interactive functionality ● Full interactive functionality
● import geemap.eefolium as geemap ● import geemap

geemap
Colab
notebook
Template
(link)

16
Citing geemap
Wu, Q. (2020).
geemap: A Python
package for
interactive mapping
with Google Earth
Engine. The Journal
of Open Source
Software. 5(51),
2305.
https://doi.org/10.211
05/joss.02305
17
Documentation

18
https://giswqs.github.io/geemap

19
Tutorials

20
Tutorials https://www.youtube.com/c/QiushengWu

21
Tutorials https://github.com/giswqs/geemap/tree/master/examples

1. Introducing the geemap Python package for interactive mapping with Google Earth Engine (video | gif | notebook)
2. Using basemaps in geemap and ipyleaflet for interactive mapping with Google Earth Engine (video | gif | notebook)
3. Introducing the Inspector tool for Earth Engine Python API (video | gif | notebook)
4. Creating a split-panel map for visualizing Earth Engine data (video | gif | notebook)
5. Using drawing tools to interact with Earth Engine data | gif | notebook)
6. Creating an interactive map with a marker cluster (video | gif | notebook)
7. Converting data formats between GeoJSON and Earth Engine (video | gif | notebook)
8. Automated conversion from Earth Engine JavaScripts to Python scripts and Jupyter notebooks (video | gif | notebook)
9. Interactive plotting of Earth Engine data with minimal coding (video | gif | notebook)
10. Using shapefiles with Earth Engine without having to upload data to GEE (video | gif | notebook)
11. Exporting Earth Engine Image and ImageCollection as GeoTIFF and Numpy array (video | gif | notebook)
12. Computing zonal statistics with Earth Engine and exporting results as CSV or shapefile (video | gif | notebook)
13. Calculating zonal statistics by group (e.g., analyzing land cover composition of each country/state) (video | gif | notebook)
14. Adding a customized legend for Earth Engine data (video | gif | notebook)
15. Converting Earth Engine JavaScripts to Python code directly within Jupyter notebook (video | gif | notebook)
16. Adding animated text to GIF images generated from Earth Engine data (video | gif | notebook)
17. Adding colorbar and images to GIF animations generated from Earth Engine data (video | gif | notebook)
18. Creating Landsat timelapse animations with animated text using Earth Engine (video | gif | notebook)
19. How to search and import datasets from Earth Engine Data Catalog (video | gif | notebook)
20. Using timeseries inspector to visualize landscape changes over time (video | gif | notebook) 22
Tutorials https://github.com/giswqs/geemap/tree/master/examples

1. Exporting Earth Engine maps as HTML files and PNG images (video | gif | notebook)
2. How to import Earth Engine Python scripts into Jupyter notebook (video | gif | notebook)
3. How to search Earth Engine API and import assets from GEE personal account (video | gif | notebook)
4. How to publish interactive Earth Engine maps (video | gif | notebook)
5. How to load local raster datasets with geemap (video | gif | notebook)
6. How to create and deploy Earth Engine Apps using Python (video | gif | notebook)
7. How to create an interactive Earth Engine App for creating Landsat timelapse (video | gif | notebook)
8. How to use your local computer as a web server for hosting Earth Engine Apps (video | gif | notebook)
9. How to use pydeck for rendering Earth Engine data (video | gif | notebook)
10. How to get image basic properties and descriptive statistics (video | gif | notebook)
11. Machine Learning with Earth Engine - Unsupervised Classification (video | gif | notebook)
12. Machine Learning with Earth Engine - Supervised Classification (video | gif | notebook)
13. Machine Learning with Earth Engine - Performing Accuracy Assessment for Image Classification (video | gif | notebook)
14. Interactive extraction of pixel values and interactive region reduction (video | gif | notebook)

23
Key Features

24
Key Features (video | gif | notebook)

● Automated conversion
from JavaScript to
Python

25
Key Features (video | gif | notebook)

● Search and import


datasets from Earth
Engine Data Catalog

26
Key Features (video | gif | notebook)

● Search GEE API


Reference and
import personal
assets

27
Key Features (video | gif | notebook)

● Add customized
legends for Earth
Engine data

28
Key Features (video | gif | notebook)

● Add basemaps (e.g.,


XYZ and WMS tiles)
not available in GEE
JavaScript API

29
Key Features (video | gif | notebook)

● Create split-panel
maps

30
Key Features (video | gif | notebook)

● Use the Inspector


tool to interact with
Earth Engine data

31
Key Features (video | gif | notebook)

● Interactive plotting
of Earth Engine data
with minimal coding

32
Key Features (video | gif | notebook)

● Interactive extraction
of pixel values and
interactive region
reduction

33
Key Features (video | gif | notebook)

● Create timelapse
animations with
animated text

34
Key Features (video | gif | notebook)

● Use timeseries
inspector to
visualize landscape
changes over time

35
Key Features (video | gif | notebook)

● Use shapefiles
stored locally

36
Key Features (video | gif | notebook)

● Use raster datasets


stored locally

37
Key Features
(video | gif | notebook)

● Publish interactive GEE


maps to be embedded
into social media or
websites

38
Key Features (video | gif | notebook)

● Publish interactive Earth


Engine Apps using
open-source Python
packages (e.g., voila)
and commercial
software packages (e.g.,
heroku, ngrok)

39
Want more features/tutorials?
● A collection of 360+ Jupyter Python notebook examples for using Google
Earth Engine with interactive mapping
(https://github.com/giswqs/earthengine-py-notebooks)
● Submit a Feature Request on the geemap GitHub repository
(https://github.com/giswqs/geemap/issues )
● Leave comments on my Geospatial Data Science Blog
(https://blog.gishub.org)
● Leave comments on my YouTube channel
(https://www.youtube.com/c/QiushengWu)
● DM me on Twitter (https://twitter.com/giswqs)

40
Thank you!
Any questions
Qiusheng Wu, PhD
Department of Geography
University of Tennessee
Email: qwu18@utk.edu
Website: https://wetlands.io
Twitter: https://twitter.com/giswqs

View publication stats wetlands.io

You might also like