ShapelyDeprecationWarning: 'type' attribute to 'geom_type' attribute
marianobonelli opened this issue · 2 comments
Welcome to the python-rasterstats
issue tracker. Thanks for putting together a bug report! By following the template below, we'll be better able to reproduce the problem on our end.
If you don't have a bug specifically but a general support question, please visit https://gis.stackexchange.com/
Describe the bug
/usr/local/lib/python3.8/dist-packages/rasterstats/main.py:156: ShapelyDeprecationWarning:
The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
The warning that appears in the provided code refers to a change in the way that Shapely, a geometry processing library, handles the 'type' attribute of geometries. Instead of using the 'type' attribute, it is recommended to use the 'geom_type' attribute. To fix this warning, the code can be modified to use the 'geom_type' attribute instead of the 'type' attribute when necessary.
To Reproduce
Steps to reproduce the behavior:
- How did you install rasterstats and its dependencies?
- What datasets are necessary to reproduce the bug? Please provide links to example data if necessary.
- What code is necessary to reproduce the bug? Provide the code directly below or provide links to it.
# Code to reproduce the error
zonal_stats = rasterstats.zonal_stats(
output_geojson, vi_array,
affine=affine, nodata=nodata,
stats="min max mean ",
geojson_out=True,
)
Feature Requests
python-rasterstats
is not currently accepting any feature requests via the issue tracker. If you'd like to add a backwards-compatible feature, please open a pull request - it doesn't need to be 100% ready but should include a working proof-of-concept, tests, and should not break the existing API.