Commit 3ee2314c authored by Daniel Scheffler's avatar Daniel Scheffler

Fixed prj_equal for pyproj<2.5.

Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 9fe3cbef
Pipeline #11903 failed with stage
in 12 minutes and 31 seconds
......@@ -85,10 +85,16 @@ def prj_equal(prj1, prj2):
if prj1 is None and prj2 is None or prj1 == prj2:
return True
else:
crs1 = CRS.from_user_input(prj1)
crs2 = CRS.from_user_input(prj2)
from pyproj import __version__ as ver
if ver.startswith('2') and int(ver.split('.')[1]) >= 5:
# CRS.equals was added in pyproj 2.5 which does not exist for Python 2.7 in conda-forge channel
crs1 = CRS.from_user_input(prj1)
crs2 = CRS.from_user_input(prj2)
return crs1.equals(crs2)
return crs1.equals(crs2)
else:
return get_proj4info(proj=prj1) == get_proj4info(proj=prj2)
def isProjectedOrGeographic(prj):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment