Description
When working with datasets that use custom coordinate reference systems (CRS) that cannot be managed by PROJ, the Dataset.recalc_bbox_on_geoserver method throws an unhandled exception.
Current Behavior
The assignment of the bbox polygon and SRID inside Dataset.recalc_bbox_on_geoserver does not handle exceptions when the CRS cannot be processed by PROJ, causing the method to fail.
Proposed Solution
The method should implement try/except exception handling as geoserver.helpers.sync_instance_with_geoserver does here.
Moreover, since the two blocks are very similar, the logic can be moved to a common Dataset method with improved logic so that:
- if the SRID is known and the reprojection can be performed, the
bbox_polygon geometry and the srid will be in the original CRS, and
- otherwise,
srid is assigned EPSG:4326 and the bbox_polygon will be the same as ll_bbox_polygon
Description
When working with datasets that use custom coordinate reference systems (CRS) that cannot be managed by PROJ, the Dataset.recalc_bbox_on_geoserver method throws an unhandled exception.
Current Behavior
The assignment of the bbox polygon and SRID inside Dataset.recalc_bbox_on_geoserver does not handle exceptions when the CRS cannot be processed by PROJ, causing the method to fail.
Proposed Solution
The method should implement try/except exception handling as
geoserver.helpers.sync_instance_with_geoserverdoes here.Moreover, since the two blocks are very similar, the logic can be moved to a common Dataset method with improved logic so that:
bbox_polygongeometry and thesridwill be in the original CRS, andsridis assigned EPSG:4326 and thebbox_polygonwill be the same asll_bbox_polygon