aboutsummaryrefslogtreecommitdiffstats
path: root/common_gdal.py
diff options
context:
space:
mode:
Diffstat (limited to 'common_gdal.py')
-rw-r--r--common_gdal.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/common_gdal.py b/common_gdal.py
index 35511a3..7333f58 100644
--- a/common_gdal.py
+++ b/common_gdal.py
@@ -128,20 +128,13 @@ def getExtent(extent : Optional[tuple[float, float, float, float]],
return polygon
-def getSpatialFilterFromGeometry(geom : ogr.Geometry,
- srs : osr.SpatialReference,
- fail_if_srs_not_equivalent : bool = False) -> ogr.Geometry:
+def getSpatialFilterFromGeometry(geom : ogr.Geometry, srs : osr.SpatialReference) -> ogr.Geometry:
"""Make the geometry suitable for use as a spatial filter. It is
- densified the SRS:s are not equivalent, unless fail_if_srs_not_equivalent is True in
- which case it errors out (this ensure clipping geometries remain simple)."""
+ densified the SRS:s are not equivalent."""
cloned = False
geom_srs = geom.GetSpatialReference()
if not geom_srs.IsSame(srs, [ 'IGNORE_DATA_AXIS_TO_SRS_AXIS_MAPPING=YES',
'CRITERION=EQUIVALENT']):
- if fail_if_srs_not_equivalent:
- raise RuntimeError(f'Geometry {geom.ExportToWkt()} has SRS ' +
- geom_srs.ExportToPrettyWkt() + ',\nexpected ' +
- srs.ExportToPrettyWkt())
# densify the geometry (a rectangle) to avoid issues when reprojecting,
# cf. apps/ogr2ogr_lib.cpp:ApplySpatialFilter()
segment_distance_metre = 10 * 1000