Skip to content

Commit

Permalink
Python: Use pyproj to check CRS equality if GDAL not available
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston committed Nov 19, 2024
1 parent f074950 commit 9baaca3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions python/src/exactextract/exact_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,23 @@ def crs_matches(a, b):
except AttributeError:
pass

return srs_a.IsSame(srs_b)
return bool(srs_a.IsSame(srs_b))

except ImportError:
return False
pass

try:
from pyproj import CRS

crs_a = CRS.from_string(a.srs_wkt())
crs_b = CRS.from_string(b.srs_wkt())

return crs_a == crs_b

except ImportError:
pass

return False


def warn_on_crs_mismatch(vec, ops):
Expand Down

0 comments on commit 9baaca3

Please sign in to comment.