Skip to content

Commit fcafdbf

Browse files
authored
Fix: Don't reproject for epsg:4326 input (#392)
Previously I had accidentally been reprojecting 4326 input because I was checking against the OGC_84 definition and not also EPSG_4326
1 parent 14a6fdc commit fcafdbf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lonboard/_geoarrow/ops/reproject.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import pyarrow as pa
1111
from pyproj import CRS, Transformer
1212

13-
from lonboard._constants import EXTENSION_NAME, OGC_84
13+
from lonboard._constants import EPSG_4326, EXTENSION_NAME, OGC_84
1414
from lonboard._geoarrow.crs import get_field_crs
1515
from lonboard._geoarrow.extension_types import CoordinateDimension
1616
from lonboard._utils import get_geometry_column_index
@@ -77,6 +77,12 @@ def reproject_column(
7777
if existing_crs == to_crs:
7878
return field, column
7979

80+
# If projecting to OGC_84, also check if existing CRS is EPSG_4326, which when
81+
# passing always_xy is equivalent.
82+
if to_crs == OGC_84:
83+
if existing_crs == EPSG_4326:
84+
return field, column
85+
8086
# NOTE: Not sure the best place to put this warning
8187
warnings.warn("Input being reprojected to EPSG:4326 CRS")
8288

0 commit comments

Comments
 (0)