[postgis-users] Axis switching in transform from SRID 4326 to 3006 (Sweref99 TM) with PostGIS 3.1.3

David Stenwall david.stenwall at icloud.com
Thu Jul 22 11:17:57 PDT 2021


And I can confirm it’s working correctly in 3.1.4dev! Nice! Thank you.

-David

> On 21 Jul 2021, at 22:29, Paul Ramsey <pramsey at cleverelephant.ca> wrote:
> 
> Also I can run your SQL against my working copy and the right answer is there
> 
> postgis32=# SELECT ST_AsText(ST_Transform('SRID=3006;POINT(675117 6580677)', 4326))  ;
>                   st_astext                  
> ---------------------------------------------
>  POINT(18.078112692195987 59.32848233749213)
> (1 row)
> 
> 
> 
> On Wed, Jul 21, 2021 at 1:25 PM Paul Ramsey <pramsey at cleverelephant.ca <mailto:pramsey at cleverelephant.ca>> wrote:
> The fix is not in any released version yet. If you pull the code from git and build you can confirm it works for your case (I'm going to guess that it will, your description matches the other N/E systems.
> 
> P
> 
> On Tue, Jul 20, 2021 at 5:12 PM David Stenwall <david.stenwall at icloud.com <mailto:david.stenwall at icloud.com>> wrote:
> Hi
> Ok, so I _think_ I have the same issue as in https://trac.osgeo.org/postgis/ticket/4949 <https://trac.osgeo.org/postgis/ticket/4949> since Sweref99 is also an N/E-type projection, also the National Projection of Sweden. I tried updating to 3.1.3 but no success.
>  
> I’m using ST_Transform to convert between lat/long and Sweref99 but the axis get reversed and a point in sweden ends up in the Indian ocean.
> 
> I’m using
> "POSTGIS=""3.1.3 008d2db"" [EXTENSION] PGSQL=""130"" GEOS=""3.9.1-CAPI-1.14.2"" PROJ=""7.2.1"" LIBXML=""2.9.10"" LIBJSON=""0.15"" LIBPROTOBUF=""1.4.0"" WAGYU=""0.5.0 (Internal)"" TOPOLOGY"
> 
> Example
> 
> SELECT ST_AsText(ST_Transform('SRID=3006;POINT(675117 6580677)', 4326))  // Sweden National Museum
> 
> returns
> 
> "POINT(62.973291540292465 4.080735770719003)”  // Somewhere east of Africa
> 
> That should be long/lat 18.078113 59.328482 according to epsg.io <http://epsg.io/>
> 
> So am I missing something or is the fix in 3.1.3 not working or is this a similar problem but not the same thing?
> 
> Regards
> David
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/postgis-users <https://lists.osgeo.org/mailman/listinfo/postgis-users>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20210722/3300af50/attachment.html>


More information about the postgis-users mailing list