-
Couldn't load subscription status.
- Fork 124
Description
Dear Dr. Wu,
I hope you are doing well. First of all, thank you for your excellent work on leafmap and whitebox. I am trying to reproduce one of the examples in the documentation, but I ran into an issue.
My setup and data details:
gdf is a valid GeoDataFrame (CRS = EPSG:3857) containing a single polygon.
Geometry type: <class 'shapely.geometry.polygon.Polygon'>
Environment: Windows, Anaconda (geopandas, shapely, rasterio, numpy, whitebox, latest leafmap and almost all other necessary libraries are installed).
Code I ran:
array = leafmap.get_3dep_dem(
gdf,
resolution=30,
output="dem.tif",
dst_crs="EPSG:3857",
to_cog=True,
overwrite=True,
)
array
Error message:
TypeError: ufunc 'create_collection' not supported for the input types,
and the inputs could not be safely coerced to any supported types
according to the casting rule 'safe'
...
File ".../leafmap/common.py", line 10585, in get_3dep_dem
geometry = geometry.geometry.unary_union
I am not sure how to solve this problem, since I am using the same code provided in your documentation. Could you please advise whether get_3dep_dem() expects a GeoDataFrame, a GeoSeries, or a shapely geometry object as input?
Thank you very much for your time and guidance.
Best regards,
Muhammad Mehdi
University of the Punjab, Lahore Pakistan
Institute of Geography
email: geomehdi12@gmail.com