ckan / ckanext-spatial

Geospatial extension for CKAN
http://docs.ckan.org/projects/ckanext-spatial
125 stars 192 forks source link

asShape is deprecated and buggy #271

Closed frafra closed 2 years ago

frafra commented 2 years ago

Shapely has deprecated asShape and similar methods in version 1.8. There are some non-critical bugs that will not be fixed: https://github.com/shapely/shapely/issues/1149#issuecomment-856449431

It would be a good idea to replace asShape with shape.

The adapters to create geometry-like proxy objects with coordinates stored outside Shapely geometries are deprecated and will be removed in Shapely 2.0 (e.g. created using asShape()). They have little to no benefit compared to the normal geometry classes, as thus you can convert to your data to a normal geometry object instead. Use the shape() function instead to convert a GeoJSON-like dict to a Shapely geometry. -- https://shapely.readthedocs.io/en/latest/migration.html

Note: ckanext-spatial does not pin to a specific version of shapely, so it could break when shapely 2.0 is released at the moment https://github.com/ckan/ckanext-spatial/blob/9831e74c9e9eedcb35fa00858190f778d83928ad/requirements.txt#L4

frafra commented 2 years ago

Fixed with PR #276.