[postgis-users] different answers for Transform and cs2cs
Obe, Regina
robe.dnd at cityofboston.gov
Fri Oct 31 05:27:35 PDT 2008
Don,
Oops slippery fingers just looked at your cs2cs - It should be more
accurately 4269 not 4326 I think.
+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs
SELECT X( Transform( SetSRID(MakePoint(-86.123456789::double
precision,34.123456789::double
precision),4269),4267 ))::double precision, Y( Transform(
SetSRID(MakePoint(-86.123456789::double
precision,34.123456789::double
precision),4269),4267 ))::double precision;
Though when I do the above - I get an error
WARNING: transform: -38 (failed to load NAD27-83 correction file)
ERROR: transform: couldn't project point: -38 (failed to load NAD27-83
correction file)
Though I suspect that's just a configuration error on my box when I
setup proj4.
Hope that helps,
Regina
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Obe,
Regina
Sent: Friday, October 31, 2008 8:12 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] different answers for Transform and cs2cs
Don,
4030 is missing datum information so I think when you transform the
datum gets ignored which
means best proj can guess is that 4030 and 4267 should return same
number since it can't tell if they are the same or different datum
4030 looks like this - "+proj=longlat +ellps=WGS84 +no_defs "
I suspect you should be using 4326 which looks like this
"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs "
When I use 4326 with your example
select
X( Transform( SetSRID(MakePoint(-86.123456789::double
precision,34.123456789::double
precision),4326),4267 ))::double precision, Y( Transform(
SetSRID(MakePoint(-86.123456789::double
precision,34.123456789::double
precision),4326),4267 ))::double precision;
I get the below which accounting for rounding differences is about the
same
-86.1234814621629;34.1233611276746
Hope that helps,
Regina
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Don
Sent: Thursday, October 30, 2008 11:11 PM
To: PostGIS Users Discussion
Subject: [postgis-users] different answers for Transform and cs2cs
I have basically the same transformration encoded below in 2 different
ways. One uses transform the other the program cs2cs. I am just
trying to convert a latlong to a different datum. It seems that I am
getting the wrong answer with Transform.
select
X( Transform( SetSRID(MakePoint(-86.123456789::double
precision,34.123456789::double
precision),4030),4267 ))::double precision from al_ent;
x
---------------
-86.123456789
-86.123456789
>cs2cs +proj=latlong +datum=NAD83 +to +proj=latlong +datum=NAD27 -f
%.12f<<EOF
> -86.123456789 34.123456789
>
> -86.123481462163 34.123361126798 -0.000032913871
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list