Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Don't reproject for epsg:4326 input #392

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lonboard/_geoarrow/ops/reproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pyarrow as pa
from pyproj import CRS, Transformer

from lonboard._constants import EXTENSION_NAME, OGC_84
from lonboard._constants import EPSG_4326, EXTENSION_NAME, OGC_84
from lonboard._geoarrow.crs import get_field_crs
from lonboard._geoarrow.extension_types import CoordinateDimension
from lonboard._utils import get_geometry_column_index
Expand Down Expand Up @@ -77,6 +77,12 @@ def reproject_column(
if existing_crs == to_crs:
return field, column

# If projecting to OGC_84, also check if existing CRS is EPSG_4326, which when
# passing always_xy is equivalent.
if to_crs == OGC_84:
if existing_crs == EPSG_4326:
return field, column

# NOTE: Not sure the best place to put this warning
warnings.warn("Input being reprojected to EPSG:4326 CRS")

Expand Down
Loading