[Gdal-dev] Confusion with gdalwarp

Frank Warmerdam warmerdam at pobox.com
Thu Jun 19 09:25:58 EDT 2003

R. Piepul wrote:

> I seem to have a misunderstanding about the use of gdalwarp and am
> hoping that someone can tell me what is wrong.  I am trying to prepare
> a GeoTiff image for use in mapserver.


> $ gdalwarp -t_srs 'proj=utm zone=14' map.tif temp1.tif
> :0...10...20...30...40...50...60...70...80...90...100 - done.


I would encourage you to explicitly include an ellipse in PROJ.4
declarations.  You are also encouraged to explicitly include a
'+' in front of PROJ.4 options.  The above apparently works, but
not because I have been careful to make it work.  So I would suggest:

  -t_srs '+proj=utm +zone=14 +datum=NAD83'

> $ gdalinfo temp1.tif
> Driver: GTiff/GeoTIFF
> Size is 4879, 4536
> Coordinate System is `'
> Corner Coordinates:
> Upper Left  (    0.0,    0.0)
> Lower Left  (    0.0, 4536.0)
> Upper Right ( 4879.0,    0.0)
> Lower Right ( 4879.0, 4536.0)
> Center      ( 2439.5, 2268.0)
> Band 1 Block=4879x1 Type=Byte, ColorInterp=Gray
> $
> $ gdal-config --version 
> 1.1.8
> $ gdal-config --ogr-enabled
> yes
> $ gdal-config --formats
> gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 bsb xpm sdts raw dted
> mem jdem envisat elas fit vrt usgsdem l1b nitf bmp hdf4 gif jpeg png
> grass

This sounds like a bug in the GDAL 1.1.8 release with the GeoTIFF
driver.  When it creates a new TIFF file with the Create() method
instead of the CreateCopy() method it fails to write the coordinate system
information out.  This bug was fixed a month or so after the GDAL 1.1.8
release.  I would encourage you to upgrade to the CVS snapshot code
and perhaps even try using gdalwarptest which works similarly but uses
a new more flexible algorithm.

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