From 9baaca3f08a3e54f8a636e6bfba9fa066c8b431b Mon Sep 17 00:00:00 2001 From: Daniel Baston Date: Tue, 19 Nov 2024 11:20:58 -0500 Subject: [PATCH 1/2] Python: Use pyproj to check CRS equality if GDAL not available Fixes /~https://github.com/isciences/exactextract/issues/159 --- python/src/exactextract/exact_extract.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/python/src/exactextract/exact_extract.py b/python/src/exactextract/exact_extract.py index b1c3dde..5d879a1 100644 --- a/python/src/exactextract/exact_extract.py +++ b/python/src/exactextract/exact_extract.py @@ -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): From 0c258af238ffed9549e89a07f3760c3a42eb8522 Mon Sep 17 00:00:00 2001 From: Daniel Baston Date: Tue, 19 Nov 2024 11:55:49 -0500 Subject: [PATCH 2/2] CI: Add libgdal-netcdf dependency --- .github/python_test_env.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/python_test_env.yml b/.github/python_test_env.yml index 5156a72..d985863 100644 --- a/.github/python_test_env.yml +++ b/.github/python_test_env.yml @@ -2,6 +2,7 @@ name: testenv channels: - conda-forge dependencies: + - libgdal-netcdf - python-build - gdal - geopandas