Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<scala-collection-compat.version>2.5.0</scala-collection-compat.version>
<geoglib.version>1.52</geoglib.version>
<caffeine.version>2.9.2</caffeine.version>
<proj4sedona.version>0.1.2</proj4sedona.version>
<proj4sedona.version>0.1.3</proj4sedona.version>

<geotools.scope>provided</geotools.scope>
<!-- Because it's not in Maven central, make it provided by default -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ class CRSTransformProj4Test extends TestBaseScala {
assertEquals(4180998.88, result.getCoordinate.y, COORD_TOLERANCE)
}

it("should apply the RT90 datum shift for EPSG:3021 to EPSG:3006 (GH-3161)") {
val result = sparkSession
.sql("SELECT ST_Transform(ST_Point(1272691.622, 6404578.16), 'epsg:3021', 'epsg:3006')")
.first()
.getAs[Geometry](0)

assertNotNull(result)
assertEquals(3006, result.getSRID)
// PostGIS reference reported in GH-3161. proj4sedona uses the proj4js
// RT90 Helmert parameters, so sub-metre differences from PROJ are expected.
assertEquals(320728.44351324334, result.getCoordinate.x, COORD_TOLERANCE)
assertEquals(6400228.104394391, result.getCoordinate.y, COORD_TOLERANCE)
}

it("should transform using PROJ string") {
val projString =
"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +no_defs"
Expand Down
Loading