Skip to content

Commit 46be389

Browse files
committed
#334 compute geometry bbox in target crs if possible
1 parent 3e970fa commit 46be389

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

openeo_driver/util/utm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import math
55
import pyproj
66
import shapely.ops
7-
from pyproj import Geod
7+
from pyproj import Geod, CRS
88
from shapely.geometry.base import BaseGeometry
99

1010
_log = logging.getLogger(__name__)
@@ -44,7 +44,7 @@ def auto_utm_epsg_for_geometry(geometry: BaseGeometry, crs: str = "EPSG:4326") -
4444

4545
# If needed, convert it to lon/lat (WGS84)
4646
crs_wgs = 'epsg:4326'
47-
if crs.lower() != crs_wgs:
47+
if CRS.from_user_input(crs).to_epsg() != 4326:
4848
transformer = pyproj.Transformer.from_crs(crs, crs_wgs, always_xy=True)
4949
x, y = transformer.transform(x, y)
5050

0 commit comments

Comments
 (0)