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")
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.
LikeLike
Do you have the PIL (https://pypi.python.org/pypi/PIL) library installed?
LikeLike
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.
LikeLike
Not sure what you mean. Do you mean the javascript code editor or a custom build tool using the GEE python library?
LikeLike
In stead of the PIL (Failed), I install Pillow & Pillow-PIL
LikeLike