Skip to main content

Tools for working with the Earth Engine from a Jupyter development environment

Project description

earthengine-jupyter

NOTICE: This is an experimental project and is not an officially supported Google project. You are welcome to use it, but we do not guarantee stability.

How to use

This lib contains a Map class that can be used to display an interactive map.

import ee
from ee_jupyter.core import colab_gee_setup
from ee_jupyter.ipyleaflet import Map
colab_gee_setup()
Verifying environment is setup for earthengine-jupyter...
✓ The package earthengine-jupyter is already installed.
✓ Authentication credentials were found.
✓ Done.
# Intialize the Earth Engine client library.
ee.Initialize()
map1 = Map(center=(37.5924, -122.09), zoom=8)
map1
Map(center=[37.5924, -122.09], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zo…

Define an Earth Engine image layer, and add it to the interactive map.

img1 = ee.Image("LANDSAT/LC09/C02/T1_L2/LC09_044034_20220127")
visualization = {
    'bands': ['SR_B4', 'SR_B3', 'SR_B2'],
    'min': 0.2 / 0.0000275,
    'max': 0.4 / 0.0000275,
}
map1.addLayer(eeObject=img1, visParams=visualization, name='Landsat scene')

We can also create an inspector object and associate it with the previously created map.

from ee_jupyter.ipyleaflet import Inspector

inspector1 = Inspector(map_object=map1)
inspector1
Inspector(layout=Layout(border_bottom='solid', border_left='solid', border_right='solid', border_top='solid', …

Typically when you create a inspector object, you will want to display it near the map.

from ipywidgets import HBox

display(HBox([map1, inspector1]))
HBox(children=(Map(center=[37.5924, -122.09], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom…

Tip With Caption

Note that when viewed on GitHub Pages you can manipulate Jupyter widgets independently, but the widgets do not interact with each other. To experience the cross-widget interactivity, open up this notebook in a Jupyter environment.

Displaying a Map Image

If you want to display a static (non-interactive) image, you can do that as well. The embed=True parameter will allow the image to be saved within the notebook.

from IPython.display import Image


visualization['dimensions'] = 400  # maximum dimension for the image
url = img1.getThumbUrl(visualization)

Image(url=url, format='png', embed=True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

earthengine-jupyter-0.0.3.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

earthengine_jupyter-0.0.3-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file earthengine-jupyter-0.0.3.tar.gz.

File metadata

  • Download URL: earthengine-jupyter-0.0.3.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.6

File hashes

Hashes for earthengine-jupyter-0.0.3.tar.gz
Algorithm Hash digest
SHA256 345be89ed7b9b52fb9599a7d3328976102dd95ad266ce0536103d63a325d9330
MD5 c3cd298a1bd3095c9ebe17cfd2bb2635
BLAKE2b-256 f383b03aa87325035c1149215822eb25e9947936a9da80ad9587c53d30627787

See more details on using hashes here.

File details

Details for the file earthengine_jupyter-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: earthengine_jupyter-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.6

File hashes

Hashes for earthengine_jupyter-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1c81c661a6bf0bb3de6ca2941d8a4482aadf508e7d5ed83dcdf279861508e499
MD5 4a7183799582ee2770083b0f37a7910a
BLAKE2b-256 1e9c6e46534ee0a168d6134711d5b9b95f96730c7bbdba537784d97afaf009e7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page