[Gdal-dev] Help handling image with gcp.
Frank Warmerdam
warmerdam at pobox.com
Wed Oct 6 16:12:31 EDT 2004
Ken Sewell wrote:
> I just started receiving some NITF files that only have GCP's. I need the
> ability to query the pixel's lat/lon. Can I do this with GCP's or is
> there a utility in GDAL that will georegister the image from the GCP?
> This what gdalinfo shows:
>
> Driver: NITF/National Imagery Transmission Format
> Size is 640, 473
> Coordinate System is `'
> GCP Projection = GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS
> 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","
> 6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9108"]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORI
> TY["EPSG","4326"]]
> GCP[ 0]: Id=UpperLeft, Info=
> (0,0) -> (-116.633,35.2542,0)
> GCP[ 1]: Id=UpperRight, Info=
> (640,0) -> (-116.66,35.2758,0)
> GCP[ 2]: Id=LowerLeft, Info=
> (0,473) -> (-116.608,35.2736,0)
> GCP[ 3]: Id=LowerRight, Info=
> (640,473) -> (-116.624,35.2889,0)
Ken,
You could run the image through "gdalwarp" which would rectify it giving
you an image with a nice geotransform. It would build a 1st order transformation
to accomplish the image warp.
Alternatively you could build an approximate geotransform (the same as it
would use for a warp) from the GCPs. This can be accomplished with the
function GDALGCPsToGeoTransform(). Note that you will need to pass bApproxOK
as TRUE.
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