I have some scripts in the Earth Engine Code Editor.
Is it possible to call these scripts remotely using Python API?
asked Jan 15, 2019 at 21:17
-
1In theory yes, possibly with very roundabout ways and browser emulation. What exactly is your use case? Earth Engine provides a set of tools that allow for automated execution, from server side apps to a dedicated Python API.Kersten– Kersten2019年01月16日 08:33:42 +00:00Commented Jan 16, 2019 at 8:33
-
@Kersten I would like to avoid browser emulation. We have scientists working on the scripts in the Code Editor. The idea is plug in these scripts into a larger project. Seems that server side apps is the only realistic option to do a remote callsKertis van Kertis– Kertis van Kertis2019年01月16日 14:04:49 +00:00Commented Jan 16, 2019 at 14:04
-
Well, you could adapt the scripts to use the Python API. That might be easiest way to have control over over the execution time with cron or other triggers.Kersten– Kersten2019年01月16日 14:54:19 +00:00Commented Jan 16, 2019 at 14:54
-
1Dear all, did you find a solution for requering custom scripts developed in JS code editor directly in Python? (e.g. script = ee.require('users/user/repository:custom_functions')José Lucas Safanelli– José Lucas Safanelli2019年08月24日 21:02:50 +00:00Commented Aug 24, 2019 at 21:02
1 Answer 1
For easy interactive use of the Python API, there is geemap
. It also has a module to convert Javascript scripts and snippets to Python
Given a Javascript script some_script
in the working directory, you can call it like so (untested):
from geemap import js_to_python
js_to_python(in_file="some_script.js",out_file="some_script.py",use_qgis=False)
and your function is in some_script.py
.
default