gdal – Comprehensive Guide to Datum Conversion with GDAL

coordinate systemdatumgdal

I run gdaltransform like so:

 gdaltransform -s_srs nad27 -t_srs wgs84
 -104.5 39.5
 -104.5 39.5 0

 gdaltransform -s_srs wgs84 -t_srs nad83
 -104.5 39.5
 -104.5 39.5 0

 gdaltransform -s_srs nad27 -t_srs nad83
 -104.5 39.5
 -104.5 39.5000000009262 4.23276796936989e-005

In other words, if gdaltransform nad27 -> wgs84 -> nad83, the lat/lon do not change.

If, however, I transform nad27 -> nad83, my latitude is ever-so-slightly different.

Why, please? What is the correct process for transforming coordinates?

I have a legacy application that only saves the datum name (e.g. NAD27, WGS84, etc) and the lat/lon. In its processing, when trying to find the lat/lon in NAD83, which is the projection defined in a 1 sec FLT .HDR file, it calls (an old DLL implementation of) CS-Map cs_cnvrt, passing in nothing more than these datum strings, and it gets an output lat/lon that are different than the input lat/lon.

When updating this code, I have this crazy idea that I'll keep all coordinate internally in WGS84, and transform them as needed by the output plane. So my code reads the NAD27 coordinates, converts to WGS84 using GDAL. It later asks GDAL to transform WGS84 to the spatial reference system (SRS) in the FLT file (i.e. NAD83). The transform results are exactly the same as the input.

This makes sense to me, but I can't understand why the two methods above are so different.

Thanks.

-reilly.

Best Answer

I would suggest to use the correct EPSG codes, that is:

EPSG:4267 NAD27
EPSG:4269 NAD83
EPSG:4326 WGS84

You will get the better values -104.500522187483 39.4999860425 between the first ones.

The last two are identical for GDAL.

Related Question