[gdal-dev] Converting coordinates (easting/Northing to WGS84 Lat/Long)

Frank Warmerdam warmerdam at pobox.com
Tue Aug 4 11:02:20 EDT 2009


Smart, Gary wrote:
> I am still having problems using the geo-transformation utilities in GDAL.
...
> // g++ -Wno-deprecated -m64 -g -o georef georef.c++ -lgdal -lm
> 
> #include "/usr/local/src/FWTools-2.0.6/include/gdal.h"
> #include "/usr/local/src/FWTools-2.0.6/include/gdal_priv.h"
> #include "/usr/local/src/FWTools-2.0.6/include/ogr_spatialref.h"

Gary,

You are including include files from FWTools, but building 64bit -
presumably linking against your own locally built libraries.  This
is a very risky practice.

Have you built and install PROJ.4?  If not, creation of transformation
objects will not work, though there should be some sort of error message
issued.

Also in the comments you write:

/* Following output is from the MapServer tutorial 
...data/raster/shdrlfi020l_ugl.tif file.  This file opens
    fine in 'openev' and gives easting/northing readouts OK.
Driver: GTiff/GeoTIFF
Projection is `'
Origin = (176371.000000,548761.000000)
Pixel Size = (1000.000000,-1000.000000)
ERROR 1: No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed.
!!!Cannot create transform from input file georef space to WGS84
*/

Well, the above geotiff has no coordinate system so it is impossible
to determine how to convert to WGS84.

/*  Following output is from a geotiff file that also works fine with 'openev'.
Driver: GTiff/GeoTIFF
Projection is `PROJCS["TM 
D-01",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 
1866",6378206.4,294.9786982139006,AUTHORITY["EPSG","7008"]],AUTHORITY["EPSG","6267"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4267"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-124.5],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]'
Origin = (138586.280052,3768995.081326)
Pixel Size = (50.000000,-50.000000)
ERROR 1: No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed.
!!!Cannot create transform from input file georef space to WGS84
*/

In this case the source coordinate system is well defined so it is
not entirely clear to me why you get the message "No PROJ.4 translation
for source SRS".  I tried running the above srs myself locally and it
worked fine.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list