[gdal-dev] Re: Warping an already georeferenced image with control points

Frank Warmerdam warmerdam at pobox.com
Wed Feb 18 10:45:57 EST 2009

Jan Hartmann wrote:

> Now, this geotiff file with gcps is just an intermediate file. When 
> warping with control points, you need first to gdal_translate the 
> original image into a second file with gcps added, and than you can 
> gdalwarp that second file into the final map, a third file. I have 
> always wondered why this intermediate gcp-file was needed: you could 
> just as well transform directly from image to map, *if* gcps could be 
> indicated with gdalwarp, or am I overlooking something? Adding a -gcp 
> option to gdalwarp would AFAICS not be very difficult, it wouldn't break 
> existing applications, and it would make warping by control points more 
> efficient, because no intermediate files have to be generated any more. 
> I think I understand how the gcp option came to be added to 
> gdal_translate: some image providers, especially satellite images, 
> provide their images with control points within the file, so the -gcp 
> option has to be retained for gdal_translate.
> So, even if I have been unable to make clear my exotic problems with 
> historical maps, could this feature, adding a -gcp parameter to 
> gdalwarp, be implemented with a reasonable amount of programming effort?


I haven't been following this discussion as closely as I might.  I think
you could gdal_translate to VRT format, instead of an intermediate GeoTIFF,
in order to add the GCPs in a VRT "wrapper" around the original GeoTIFF.
This will hopefully support GCP+SRS and geotransform+SRS.

I'm a bit hesitant to add the -gcp logic into gdalwarp as it already has
a very complicated interface, and because it would require wrapping the
input dataset in a VRT internally to accomplish the functionality without
overly complicating the rest of the calls into the library.

But, if the gdal_translate approach is unsuitable, I can ask Chaitanya to
implement that.

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