sedona icon indicating copy to clipboard operation
sedona copied to clipboard

[SEDONA-39] Fix lon/lat order in ST_Transform to be consistent with PostGIS

Open jiayuasu opened this issue 3 years ago • 4 comments

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

  • Yes, the URL of the assoicated JIRA ticket is https://issues.apache.org/jira/browse/SEDONA-39. The PR name follows the format [SEDONA-39] my subject.

What changes were proposed in this PR?

How was this patch tested?

Did this PR include necessary documentation updates?

jiayuasu avatar Jun 30 '22 19:06 jiayuasu

@netanel246 @Imbruced @yitao-li

Since Sedona 1.0.0, ST_Transform uses lat/lon order, instead of lon/lat order in GeoSpark. So now Sedona behavior is different from what PostGIS does.

Currently, who uses lon/lat order can (1) use ST_FlipCoordinates twice, before and after ST_Transform. or (2)System.setProperty("org.geotools.referencing.forceXY", "true");

Do you think it is good to change back to lon/lat in this PR?

jiayuasu avatar Jun 30 '22 20:06 jiayuasu

I think we should be aligned with PostGIS. However, we must be clear about staying with lat/lon order and emphasize that users need to update their code if they use this version.

netanel246 avatar Jul 02 '22 20:07 netanel246

I agree with @netanel246 we should be consistent with what Postgis does. And definitely we need communicate that clearly with users.

Imbruced avatar Jul 03 '22 10:07 Imbruced

@netanel246 @Imbruced Got it. I will then continue working on this PR.

jiayuasu avatar Jul 03 '22 19:07 jiayuasu