Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No data display #40

Closed
12rambau opened this issue Mar 15, 2021 · 10 comments
Closed

No data display #40

12rambau opened this issue Mar 15, 2021 · 10 comments

Comments

@12rambau
Copy link
Contributor

I know that this is the exact same title as #39 But as the OP now have a solution that cannot be used in my case I preferred to open a new one.

I'm working on a company environment so I have no opportunity to start from a "fresh" conda env and I'm force to better understand the libs we use. We were using the lib to display raster as in the geemap librairy and it was working very effectivelly.

As referred here, we recently lost the abbility to load anything on the map...

I checked my configuration over the one in setup.py

setup.py our environment
jupyter_server>=0.2.0 jupyter-server==1.4.1
rioxarray>=0.0.30 rioxarray==0.3.1
ipyleaflet>=0.13.1 ipyleaflet==0.13.3
pillow>=7 Pillow==8.1.1
ipyspin>=0.1.1 ipyspin==0.1.5
mercantile>=1 mercantile==1.1.6
affine>=2 affine==2.3.0
matplotlib>=3 matplotlib==3.3.4

It should work but instead the spinning wheel turns forever and nothing appears on the map.

I also check the javascript console and appart from warnings about the cartoDB basemap, nothing.

Would you think about anything that could prevent the loading of the generated tiles ? (I'm in particular thinking about authorization to read or write in specific folder but I don't knwo which one to verify)

@davidbrochart
Copy link
Collaborator

By default tiles are saved in tempfile.TemporaryDirectory(prefix='xarray_leaflet_'). On Linux this will translate to a path starting with /tmp/xarray_leaflet_. So you can e.g. ls -lrt /tmp and see if something has been written there.
In the browser you could look at the network analyzer and see the status of the requests corresponding to the tiles.

@12rambau
Copy link
Contributor Author

Well, I gave all I had but it's clearly beyond my skills ;-)

new intel

The tmp/xarray_leaflet_turlutut/ folder is never filled or created so I don't have any tiles to load. but the tmp can be written so normally no problem there.

I don't see any requests in the network analyser, I have the feeling that this step is never reached.

I want to mention that our env is in Python 3.6.9 and that my ipyleaflet version is limited to 0.13.3 by geemap. but I don't see any problem according to your setup.py.

I tried to display a lot of intermediate output to see where it was blocked but I can't get the output_debug to work properly. It writes the first print statement but as soon as we go to async def or functions called by the observe on "bounds" I see nothing.

Question:

url

The shape of the url to fetch the tiles (base_url) must look like the following right:

https://sepal.io/api/sandbox/jupyter 

Basically everything up to the first "jupyter"

That makes a final url of the form :

https://sepal.io/api/sandbox/jupyter/xarray_leaflet/tmp/xarray_leaflet_turlututu/{z}/{x}/{y}.png

If this is the case, I have to modify the base_url construction, I made a mistake for lab in my last PR.

fit_bounds functions

Then if I set fit_bounds to False, async_wait_for_bounds doesn't launch if I don't zoom right ?

@giswqs
Copy link

giswqs commented Mar 16, 2021

@12rambau You can update ipyleaflet to the latest version and geemap should work just fine. The reason I put ipyleaflet v0.13.3 is because ipyleaflet>0.13.3 pip installation does not work properly on Windows jupyter-widgets/ipyleaflet#769. For conda installation, geemap should automatically install the latest ipyleaflet. https://github.com/conda-forge/geemap-feedstock/blob/master/recipe/meta.yaml

@12rambau
Copy link
Contributor Author

@giswqs is it still working on your side in geemap ?

@giswqs
Copy link

giswqs commented Mar 16, 2021

I just tested the notebook example on my Linux machine with Python 3.8 and ipyleaflet 0.13.6. It works fine.

https://geemap.org/notebooks/25_load_rasters

Peek.2021-03-16.10-33.mp4

@12rambau
Copy link
Contributor Author

12rambau commented Mar 16, 2021

ok so I welcome myself in the compatibility nightmare

I think I find a solution.

  • first the jupyterlab url is weirdly handle (and I wrote this part of the code so I'm the only one to blame)
  • I effectively needed to updated my version of ipyleaflet and traitlet to the latest available on 3.6.9 (i.e. -> 4.3.3)
  • As explained in this issue (sepal #64) We are experiencing a real problem with the GDAL and rasterIocompatibility in our platform. Here I also neede to discard the PROJ_LIB env variable to ue your lib

Good thing though is that now that I really dig in your code @davidbrochart, I better understand what you've done and better understand the power of async function. Thanks and congrats !

I will close this issue once everything is set on the prod env of the SEPAL website

@bmcandr
Copy link

bmcandr commented May 3, 2021

It should work but instead the spinning wheel turns forever and nothing appears on the map.

Hi, I'm experiencing this issue as well on both Linux and Mac.

  • Linux:
    I'm trying to use xarray_leaflet in a notebook running in a Ubuntu-based Docker container on a JupyterHub. I initially encountered this issue while working on my own notebook, but I am able to replicate it with the introduction.ipynb notebook. I see a /tmp/xarray_leaflet_* directory, but it is empty. The "loading" wheel spins endlessly

  • Mac:
    Again, I've tried both my own notebook and the introduction.ipynb demo notebook from this repo. The /var/folders/**/**/**/xarray_leaflet_* directory exists and the tiles appear to be written. The map remains blank aside from the basemap, however.

I do not encounter this issue in the Binder for this repo.

@davidbrochart
Copy link
Collaborator

Maybe you could have a look at the debug_output in the dynamic.ipynb notebook?

@peterhob
Copy link

peterhob commented Jun 14, 2021

#42 helped solve this issue. I modified the code block

if self.url.endswith('/lab'):
    # we are in JupyterLab
    self.base_url = self.url[:-4]

to

if self.url.find('/lab/') != -1:
    # we are in JupyterLab
    i_lab=self.url.find('/lab/')
    self.base_url = self.url[:i_lab]

@davidbrochart
Copy link
Collaborator

See #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants