[Gdal-dev] Fixing projections with GDAL_TRANSLATE vs. GDALWARP

Frank Warmerdam warmerdam at pobox.com
Wed Sep 12 12:59:07 EDT 2007


Rich Signell wrote:
> GDAL-folk,
> 
> I'm hoping that someone will see in 2 minutes what I've spend 2 hours
> trying to figure out.
> 
> I was given a  GeoTIFF image but the parameters specified for the
> projection are obviously wrong, as the latitudes displayed by
> "gdalinfo" are about 33 degrees, but should be approximately 43
> degrees.
> 
> The creator of the image told me the correct projection parameters,
> and he wanted a geographic image, so I tried two ways of converting
> them:
> 
> If I fix the projection and convert to EPSG:4326 in 1 step, using
> "gdalwarp", my image "geo1.tif" is correctly geolocated:
> 
> $ gdalwarp -s_srs "+proj=merc +lat_ts=41.65 +lon_0=-70.3166667
> +datum=nad83" -t_srs EPSG:4326 mb_backpc30m.tif geo1.tif
> 
> If I fix the projection and convert to EPSG:4326 in 2 steps, using
> "gdal_translate" and then "gdalwarp" my image "geo2.tif" is not
> correctly geolocated.
> 
> $ gdal_translate -a_srs "+proj=merc +lat_ts=41.65 +lon_0=-70.3166667
> +datum=nad83" mb_backpc30m.tif merc.tif
> $ gdalwarp -t_srs EPSG:4326 merc.tif geo2.tif
> 
> I don't understand why these two operations don't give the same result.
> 
> If some kind soul is willing to take a look, the original image is at:
> 
> http://stellwagen.er.usgs.gov/rps/share/mb_backpc30m.tif  (~6 mb)

Rich,

I believe the problem is that GDAL and/or libgeotiff is confused
about the correct representation of Mercator 1SP in GeoTIFF format.
I think this is related to the Mercator 1SP issue Allan Meek raised
recently:

   http://trac.osgeo.org/gdal/ticket/1797

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list