[MetaCRS] Re: [postgis-users] st_transform, irreversible?

Mikael Rittri Mikael.Rittri at carmenta.com
Thu Aug 12 05:42:35 EDT 2010


Christopher is right, that the longitude and latitude seems
to be in the wrong order. And the implementation of tmerc 
in Proj4 is not accurate when your longitude is too far from 
the central meridian (this has been discussed on the Proj
mailing list, one or two years ago). 

I can add that the narrow bounds for the projection, cited 
by Christopher from EPSG, only applies to large scale 
applications.  For medium and small scale applications,
the projection is used in all of Sweden, so 21E 59N is 
a fairly reasonable test point. 

Mikael Rittri
Carmenta AB
Sweden 
www.carmenta.com

-----Original Message-----
From: metacrs-bounces at lists.osgeo.org
[mailto:metacrs-bounces at lists.osgeo.org] On Behalf Of
christopher.schmidt at nokia.com
Sent: den 11 augusti 2010 22:54
To: pramsey at opengeo.org
Cc: erik at slagkryssaren.com; metacrs at lists.osgeo.org;
postgis-users at postgis.refractions.net
Subject: Re: [MetaCRS] Re: [postgis-users] st_transform, irreversible?

Coordinates are outside the published bounds for the projection:

WGS84 Bounds: 14.0900, 56.0000, 16.9400, 68.0000

in fact, they appear to be outside by a long way, as if someone is doing
something backwards...

crschmidt at helios:~$ echo "21 59" | proj +proj=tmerc +lat_0=0
+lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m
+no_defs | invproj +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1
+x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs
21dE    59dN

So I think this might be a user error...

On Aug 11, 2010, at 4:39 PM, ext Paul Ramsey wrote:

> Removing the EPSG lookup from the equation changes nothing:
> 
> echo "59 21" | proj +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1
> +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs | invproj 
> +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0

> +ellps=bessel +units=m +no_defs
> 
> 58d49'47.733"E	21d2'54.745"N
> 
> P.
> 
> On Wed, Aug 11, 2010 at 1:35 PM, Paul Ramsey <pramsey at opengeo.org>
wrote:
>> Seems to be an underlying problem with proj4:
>> 
>> echo "59 21" | proj "+init=epsg:3021" | invproj "+init=epsg:3021"
>> 
>> 58d49'47.733"E  21d2'54.745"N
>> 
>> And that's without doing the datum shift part.
>> 
>> P
>> 
>> On Wed, Aug 11, 2010 at 1:10 PM, Erik Rehn <erik at slagkryssaren.com>
wrote:
>>> Hello Postgis Users!
>>> 
>>> This is my first post on this list so I will start by asking a 
>>> simple (and probably stupid) question. :)
>>> 
>>> While using ST_AsKml() to produce an overlay for Google Earth I 
>>> noticed that all my geometries where shifted slightly south-east.
>>> I figured this had something to do with the transformation between 
>>> the projection that my geometries are stored in (SRID 3021) and 
>>> WGS84 (4326) that is outputted by ST_AsKml()
>>> 
>>> Just to test I ran this:
>>> 
>>> SELECT ST_AsText(
>>>    ST_Transform(
>>>        ST_Transform(
>>>            ST_GeomFromText('POINT(59 18)',4326),
>>>        3021),
>>>    4326));
>>> 
>>> I input a point in WGS84 (59,18), transforms it to 3021 and then 
>>> back to WGS84. The result I get is:
>>> POINT(58.8672757036296 18.0394763349359)
>>> 
>>> Can anyone explain this? Am I missing something regarding
ST_Transform()?
>>> 
>>> Im running Postgis 1.5 on Windows.
>>> 
>>> Thank you for any help!
>>> /Erik
>>> 
>>> --
>>> Erik Rehn
>>> Slagkryssaren
>>> erik at slagkryssaren.com
>>> www.slagkryssaren.com
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>> 
>> 
> _______________________________________________
> MetaCRS mailing list
> MetaCRS at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/metacrs

_______________________________________________
MetaCRS mailing list
MetaCRS at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/metacrs


More information about the MetaCRS mailing list