3

I have some scripts in the Earth Engine Code Editor.

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

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jan 15, 2019 at 21:17
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. 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. 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.

answered Dec 20, 2021 at 15:04
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.