Display maps with the GEE python library

Access the Google Earth Engine database and tools using your own code editor and visualise the maps.

Just a simple example..

Step 1: Install the GEE python api.

Step 2: Run the code below.

# Import the Earth Engine Python Packages
import ee
import ee.mapclient

# Initialize the Earth Engine object, using the authentication credentials.
ee.Initialize()

# Print the information for an image asset.
image = ee.Image('srtm90_v4')

# create the vizualization parameters
viz = {'min':0.0, 'max':4000, 'palette':"000000,0000FF,FDFF92,FF2700,FF00E7"};

# display the map
ee.mapclient.addToMap(image,viz, "mymap")

5 comments

  1. Bạn đã chạy thử đoạn code này chưa? ee.mapclient cần đến Tkinter mà Tkinter không chạy được cho webapp…

    Cho mình thêm thông tin nhé. Thanks.

    Like

  2. Thank you for your comment.

    Of course I did, and PIL need to import ImageTK, and ImageTK need to import _tkinter library.

    The problem here is _tkinter is provided in _tkinter.pyd (Windows) and _tkinter.so (Linux), but not _tkinter.py while GEE Python cannot read the library which are not *.py format.

    It is working fine if you run above codes in Python Console (or Terminal), but you cannot make it run in your web app.

    Do you have any alternative.

    Thanks in advance.

    Like

Leave a Reply