[Gdal-dev] gdaltindex reports no prj defined, gdalinfo disagrees, maybe

Frank Warmerdam warmerdam at pobox.com
Tue Oct 7 14:34:21 EDT 2003


Matt.Wilkie wrote:
> Hi,
> 
> I have an orthophoto tiff which gdaltindex ignores:
> 
> 	It appears no georeferencing is available for
> 	`sheet9_east.tif', skipping.
> 
> gdalinfo reports a GCP projection but the corner coordinates at the end
> appear to be in pixels instead of projected numbers. This image came with a
> file called "sheet9_south.txg". I don't know what application created it.
> 
> Because I trust gdal more than most other programs I've used, I'm usually
> inclined to think the gtiff metadata is incorrectly formatted. However
> ArcCatalog (8.3) reads the projection. To be more precise it reports corner
> coordinates -almost- the same as the GCP's reported by gdalinfo. 
> 
> To make things a little more confusing, the .txg file's corner coords are
> out from both gdalinfo and arccatalog significantly (in the hundreds digit
> place for northings, thousandth for eastings). 
> 
> Also the reported cell size differs between applications. 
> 
> Is all this variation normal? Is it just the gtiff equivalent of is a a
> megabyte 1024k or 1000k? And more practically, what do I do about it? How
> can I fix these images so both arccatalog and gdal utilities can use them?

Matt,

Sorry for not responding sooner.  That's what you get for asking a complicated
question!

The summary of what is going on is that gdaltindex (and perhaps MapServer in
general) doesn't support raster files with GCPs instead of a simple affine
transform for raster files.  So, GDAL can read the projection definition
just fine, but it doesn't support rendering files georeferenced via GCPs
instead of a reference point and pixel size.

I don't know why the extents in the .txg are so noticably different than
the control georeferenced locations of the control points themselves.  Ask
ESRI. I am confident that the pixel/line and georeferenced e/n values for
the GCPs are the actual values that appear in the GeoTIFF headers.

PS. you can't practically clip the first bit of a geotiff file for review
as most geotiff files actually write the "directory" at the end of the
file.

PPS.  If you want to use this image with MapServer, just run it through
gdalwarp first.  This will resample the image "north up" and you won't have
to worry about control point issues.

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