3

I have some scripts in the Earth Engine Code Editor.

Is it possible to call these scripts remotely using Python API?

4
  • 1
    In 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
    Commented 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 calls Commented 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
    Commented Jan 16, 2019 at 14:54
  • 1
    Dear 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') Commented Aug 24, 2019 at 21:02

1 Answer 1

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.