[Gdal-dev] Geotiff metadata conversion?
Frank Warmerdam
warmerdam at pobox.com
Fri Jan 23 18:00:20 EST 2004
Don Tidrow wrote:
> I have a set of geotiff images that I need to be able to reproject into
> lat/long space in order to slice them up into tiles of specific
> dimensions (in arcseconds). The output of gdalinfo for the files looks
> like this:
>
> Driver: GTiff/GeoTIFF
> Size is 7876, 12796
> Coordinate System is `'
> GCP Projection = GEOGCS["unnamed",DATUM["WGS_1984",SPHEROID["WGS
> 84",6378137,298.2572235629972,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]
>
> GCP[ 0]: Id=1, Info=
> (0,0) -> (-76.6208,37.1811,0)
> GCP[ 1]: Id=2, Info=
> (7876,0) -> (-76.5321,37.1823,0)
> GCP[ 2]: Id=3, Info=
> (0,12796) -> (-76.6184,37.0658,0)
> Metadata:
> TIFFTAG_SOFTWARE=Sensor Systems RemoteView
> TIFFTAG_DATETIME=2004:00:14 11:44:23
> Corner Coordinates:
> Upper Left ( 0.0, 0.0)
> Lower Left ( 0.0,12796.0)
> Upper Right ( 7876.0, 0.0)
> Lower Right ( 7876.0,12796.0)
> Center ( 3938.0, 6398.0)
> Band 1 Block=1024x1024 Type=Byte, ColorInterp=Gray
>
...
> Is there a gdal utility/function(s) that will convert from the first
> format into the second, or is there simply not enough metadata in the
> first geotiff to convert it?
Don,
The file above has georeferencing "described" by 3 control points at the
top left, top right, and bottom left. These are sufficient to generate
an affine transformation describing the file. The simplies way to resample
the file into a north-up file would be to just run gdalwarp on it.
eg.
gdalwarp in.tif out.tif
Internally gdalwarp will produce a 1st order polynomial based on the GCPs,
warp the image into the same coordinate system (WGS84) but with a nice
north up georeferencing transform.
You may however run into problems if a 1st order, 3 point derived
polynomial is not enough to accurately warp the image. Unless the image
is already resampled on a lat/long grid but sheared or rotated a bit for
some reason, it is unlikely you will get good results. In that case, as
you suggest, the 3 lat/long control points may not be enough to accurately
describe the image location.
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