[Gdal-dev] Help handling image with gcp.

Frank Warmerdam warmerdam at pobox.com
Wed Oct 6 23:13:14 EDT 2004


Stephane Routelous wrote:
>>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.
> 
> 
> Hi Frank,
> 
> is that different than using 
> void* transformer = GDALCreateGCPTransformer(...)
> followed by 
> GDALGCPTransform(transformer,...) for the 4 corner points and from those
> points computing the transformation with
> 	georef[0] = m_upperLeftX;
> 	georef[3] = m_upperLeftY;
> 	georef[2] = 0;
> 	georef[4] = 0;
> 	georef[1]= (m_lowerRightX - m_lowerLeftX)/((double)m_nSizeX);
> 	georef[5]= -(m_upperRightY - m_lowerRightY)/((double)m_nSizeY);
> ?
> In this case, there is no approximation ?
> Am I wrong ?

Stephane,

The "gcp transformer" just builds an approximate 1st order polynomial
internally so the approximation is just moved somewhere else.

Furthermore, the geotransform you show computing is "north up" while
my proposed solution can also account for shear and rotation.

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