I work on Jupyter lab notebook on my local PC.
I want to download images from Google Earth Engine based on a shape I have, which is a GeoPandas.
The GeoPandas dataframe I have is coming from a shapefile that I have on my local computer, that was manipulated on Jupyter lab (I have applied the envelope function on polygons I have).
When I try to convert it to EE object, it never works:
#plots is the dataframe that I have uploaded from a shapefile that is local on my computer
fc = geemap.geopandas_to_ee(plots)
It works only if I save the data on the GEE platform as asset.
Is there any way I can convert local files on my PC to EE object without manually upload them as assets to EE platform?
Best Answer
You can convert your dataframe to GeoJSON (https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.to_json.html). The GeoJSON can then be used to generate an
ee.FeatureCollection
, which you finally use to filter youree.ImageCollection
.