[postgis-users] NAD conversion problem
Dylan Beaudette
debeaudette at ucdavis.edu
Thu Dec 11 09:44:21 PST 2008
On Thursday 11 December 2008, Peter N. Schweitzer wrote:
> Dylan Beaudette wrote:
> > Strange. I have never modified that code before, and regularly get the
> > correct output... I will post back with a similar example that causes
> > PostGIS to throw the '-38' error.
>
> Dylan,
>
> Another correspondent indicated to me that when he applied this change,
> he got different, better results even though he wasn't seeing this
> specific error message (perhaps because he wasn't at the psql prompt
> when the transform operation occurred). We're both running Linux.
>
> How do you know what the correct output is?
>
> Peter
Hi Peter,
It is always good to check on what you think software is doing.
Checking with proj4 (Rel. 4.6.0, 21 Dec 2007) -- linux / compiled from source
# compute shift from NAD27 -> NAD83
echo '-121.000000 37.000000' | cs2cs +proj=latlong +datum=NAD27 \
+to +proj=latlong +datum=NAD83
# result: first in DD, then DMS
-121.001029 36.999945
121d0'3.704"W 36d59'59.804"N
# result from NADCON
# http://www.ngs.noaa.gov/cgi-bin/nadcon.prl
NAD 27 datum values: 37 00 0.00000 121 00 0.00000
NAD 83 datum values: 36 59 59.80376 121 00 3.70364
Looks pretty close to me.
Lets check PostGIS, compiled with Proj4 support:
-- convert NAD27 -> NAD83
SELECT AsText(
ST_Transform(SetSRID(ST_MakePoint(-121.000000,37.000000), 4267), 4269)
) ;
astext
-------------------------------------------
POINT(-121.001028788906 36.9999454900731)
Looks close to the output from proj4 above.
Thoughts?
Dylan
--
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341
More information about the postgis-users
mailing list