gee-community/geemap

Javascript Example 120 conversion does not work with EE Repo

biplovbhandari opened this issue · 4 comments

Environment Information

Please run the following code on your computer and share the output with us so that we can better debug your issue:

import geemap
geemap.Report()

Mon Feb 20 21:06:06 2023 UTC
OS Linux CPU(s) 2 Machine x86_64
Architecture 64bit RAM 12.7 GiB Environment IPython
Python 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]
geemap 0.20.0 ee 0.1.341 ipyleaflet 0.17.2
folium 0.12.1.post1 jupyterlab Module not found notebook 6.3.0
ipyevents 2.0.1

Description

I was trying to run this example: https://geemap.org/notebooks/120_javascript/ especially the EE repo example at the end.

It does not work and give me error. I could not setup oeel in my m1 mac to help fix the bug. I am interested in testing out nested require in js file, for example a js has require which has another require in it.

What I Did

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-21-22010224fb00>](https://localhost:8080/#) in <module>
----> 1 lib = geemap.requireJS('users/gena/packages:grid')

1 frames
/usr/local/lib/python3.8/dist-packages/geemap/common.py in change_require(lib_path)
  13019 
  13020     if not os.path.exists(lib_path):
> 13021         raise ValueError(f"{lib_path} does not exist.")
  13022 
  13023     output = []

ValueError: packages/grid does not exist.

You need to set up Git properly to clone Git repos from Earth Engine. If you have never cloned a Git Repo from Earth Engine, the notebook example will not work. This blog might be helpful.

Also, I believe oeel does not work with nested require in JS files. It is not designed for handling complicated JS scripts. Be cautious about spending much time on this. It will probably not work as expected.

I was trying to do it using EE repo and it appears to be cloning the EE git repo here. Anyways, I hosted the EE git repo in Github and provided that path. But the EE repo does not seem to be working as expected on my end.
And thanks for the warning on the nested JS files in oeel.

Please provide source code that can reproduce the issue.