gee-community/geemap

the displayed FeatureCollection are images ?

12rambau opened this issue · 6 comments

I am building documentation based on geemap to display some information coming from GEE. 2 relevant lib here are pygaul and pygadm.

Let's have a look to the documentation of pygadm and specifically the part where I explain how to load GADM data into GEE: https://pygadm.readthedocs.io/en/latest/usage.html#simplify-geometry

If your computer is in light mode you will see the following:

image

Now turn the documentation to dark theme:

image

The basemaps disapears behind a gray background. It's related to an issue raised in the pydata-sphinx-theme: pydata/pydata-sphinx-theme#1578

So I understand that the featureCollection are not displayed as vectors data but as images? Is it a wanted feature?

This doesn't seems a geemap/ipyleaflet issue but rather a Sphinx issue. All Earth Engine layers are just tile layers like the basemap layers, which are png tiles. Both Earth vector and raster data are rendered as png tiles. You can use Map.layers to see the tile URLs.

The answer to your question is: yes, Earth Engine feature collections are rendered as images, just like OpenSteetMap is rendered as images. You can open the network tab in Chrome to see the png tiles that requested in real time based on the map view and zoom level.

My point was that ipyleaflet offers other options to display vector data, namely:

That are all dedicated to vector data specifically. A use case where the current implementation would be for me an issue is when I crawl the layers in my geemap object and try to split the vectors from the images. It would not be possible as they are all TileLayer.
Also note that leaflet always displays vectors on top of image which is not the case if everything is a TileLayer.

Ipyleaflet geojson and geodata for rendering vector data are not scalable. It simply dumps all data into the html. They are only suitable for tiny vector datasets (a few MBs). ipyleaflet simply can't render large vector datasets. Vector tiles are scalable, but Earth Engine does not generate vector tiles, so the vector tile option can't be considered here.

If you really want to render ee.FeatureCollection as vector, you can use geemap.ee_to_gdf() and then Map.add_gdf(). However, the same ipyleaflet limitation applies. Not good for large vector datasets.

fair enough as long as it's under control and a clear technical decision I'm good, let me close this issue.