You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "umartin (via GitHub)" <gi...@apache.org> on 2026/07/24 13:18:33 UTC
[I] ST_Transform is off by > 180 meters since Sedona 1.9 [sedona]
umartin opened a new issue, #3161:
URL: https://github.com/apache/sedona/issues/3161
Transforming coordinates between the two most common CRS in Sweden is off by > 180 meters since Sedona 1.9
Postgis:
```
# select ST_AsText(ST_Transform(ST_Point(1272691.622, 6404578.16),'epsg:3021','epsg:3006'));
st_astext
---------------------------------------------
POINT(320728.44351324334 6400228.104394391)
```
Sedona 1.8.0:
```
+--------------------------------------------------------------------------------+
|st_astext(st_transform(st_point(1272691.622, 6404578.16), epsg:3021, epsg:3006))|
+--------------------------------------------------------------------------------+
|POINT (320728.44366995635 6400228.107803337) |
+--------------------------------------------------------------------------------+
```
Sedona 1.9.0:
```
+--------------------------------------------------------------------------------+
|st_astext(st_transform(st_point(1272691.622, 6404578.16), epsg:3021, epsg:3006))|
+--------------------------------------------------------------------------------+
|POINT (320884.3637323502 6400318.840709686) |
+--------------------------------------------------------------------------------+
```
Distance:
```
# select st_distance(st_geomfromtext('POINT (320728.44366995635 6400228.107803337)'),st_geomfromtext('POINT (320884.3637323502 6400318.840709686)'));
st_distance
--------------------
180.39824320494563
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ST_Transform is off by > 180 meters since Sedona 1.9 [sedona]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu closed issue #3161: ST_Transform is off by > 180 meters since Sedona 1.9
URL: https://github.com/apache/sedona/issues/3161
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ST_Transform is off by > 180 meters since Sedona 1.9 [sedona]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu commented on issue #3161:
URL: https://github.com/apache/sedona/issues/3161#issuecomment-5100660917
Hey @umartin ,
Thanks for reporting this. We traced the regression to the incomplete RT90 datum registry in the proj4sedona version bundled with Sedona 1.9.0. EPSG:3021 was being transformed without its required Helmert parameters.
The fix is merged in [#3191](https://github.com/apache/sedona/pull/3191) and will be included in the next Sedona release next week.
Until then, the safest workaround is to provide the complete EPSG:3021 PROJ definition:
```sql
SELECT ST_AsText(ST_Transform(
ST_Point(1272691.622, 6404578.16),
'+proj=tmerc +lat_0=0 +lon_0=15.8082777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs +type=crs',
'EPSG:3006'
));
```
Verified with the released Sedona 1.9.0 shaded artifact, this returns:
```text
POINT (320728.44351324247 6400228.104394391)
```
This matches the reported PostGIS result. For real data, replace `ST_Point(...)` with the geometry column.
Alternatively, if the GeoTools wrapper is installed, temporarily use the legacy backend:
```sql
spark.sedona.crs.geotools=all;
```
Note that this routes every vector `ST_Transform` call through GeoTools.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ST_Transform is off by > 180 meters since Sedona 1.9 [sedona]
Posted by "umartin (via GitHub)" <gi...@apache.org>.
umartin commented on issue #3161:
URL: https://github.com/apache/sedona/issues/3161#issuecomment-5070564915
In the far north of Sweden it's even worse. If I convert 'SRID=3021:POINT (1686382 7767034)' to SWEREF99 (EPSG 3006) it's of by more than 300 meters.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ST_Transform is off by > 180 meters since Sedona 1.9 [sedona]
Posted by "umartin (via GitHub)" <gi...@apache.org>.
umartin commented on issue #3161:
URL: https://github.com/apache/sedona/issues/3161#issuecomment-5101208100
Thanks @jiayuasu !
That was fast! Looking forward to the next Sedona release. I was able to use the spark.sedona.crs.geotools=all workaround for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org