[Gdal-dev] adding 1 GCP pointless?

Rhys Ickeringill ickers at bigpond.com
Sun Feb 12 07:20:36 EST 2006


Hi Maciek,

On Sun, 12 Feb 2006 08:22:01 +1100, Maciek Sieczka <werchowyna at epf.pl>  
wrote:
> Hi,
>
> I have just had the same issue which was left unanswered here
> http://lists.maptools.org/pipermail/gdal-dev/2005-March/005352.html
>
>
>
> Adding a single GCP doesn't yield an error:
>
> $ gdal_translate -gcp 100 100 2000 2000 lzn.tif lzn2.tif
>
> But the GCP is not added:
>
> $ gdalinfo lzn2.tif
> Driver: GTiff/GeoTIFF
> Size is 720, 360
> Coordinate System is `'
> Metadata:
>   AREA_OR_POINT=Area
>   TIFFTAG_DOCUMENTNAME=/home/fishoo/tmp/lzn.tif
>   TIFFTAG_XRESOLUTION=98
>   TIFFTAG_YRESOLUTION=96
>   TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
> Corner Coordinates:
> Upper Left  (    0.0,    0.0)
> Lower Left  (    0.0,  360.0)
> Upper Right (  720.0,    0.0)
> Lower Right (  720.0,  360.0)
> Center      (  360.0,  180.0)
> Band 1 Block=720x11 Type=Byte, ColorInterp=Red
> Band 2 Block=720x11 Type=Byte, ColorInterp=Green
> Band 3 Block=720x11 Type=Byte, ColorInterp=Blue
>
>
> I noticed 2 GCPs is the minimum number to be effectively added. What is
> the reason? Is it that less than 2 is not enough for warping the image
> after? But is 2 enough? I though 1st order affine requires at least 3...
>
I can't answer the GDAL specific questions, but more generally...

A linear transform (a special case of an affine transform) requires two  
GCPs - this is minimum required to solve for the four image parameters  
offset (dx,dy), scale and orientation. Adding a third GCP allows extra  
possibilities including:
	* Some form of statistical analysis (ususally based on least squares  
techniques).
	* Solving of full affine transform (which includes an image shear  
parameter - there are pros and cons to doing this with remotely sensed  
data)

> What i was trying to accomplish by adding 1 GCP is the following thing:
> I've lost a worldfile for my tif. But I know the coordinates of one
> characterstic object in the image. I thought I could just add it as
> GCP using gdal_translate and then "move" the whole image to it's
> destination with gdalwarp. Is this impossible?
>
Unlikely AFAIK. With only one GCP, image scale and orientation cannot be  
calculated. If you are lucky and have (1) an image that has already been  
warped + resampled so the pixels are parallel to your chosen datum (2)  
have scale encoded in the TIF (I *think* TIFF format supports this), there  
may be value in using this one GCP to translate the image. If this is not  
the case, warping this image with gdal will be of no value.

> Could gdal_translate issue a warning if adding 1 GCP is really
> pointless?
>
> Best,
> Maciek
>

HTH,

Rhys

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the Gdal-dev mailing list