[Gdal-dev] GCPs to geo transform
Frank Warmerdam
warmerdam at pobox.com
Sat Feb 25 10:37:46 EST 2006
Antoine Hue wrote:
> Hello Frank,
>
> Thanks for the answer. That is what I am looking for, I will try it as
> soon as possible .
> What do you mean by approximate? Is it less precise than a warp?
> Would a warp get better result because of the resampling and filters?
Antoine,
The geotransform computed from the GCPs is just a first order transform.
It can represent translation, rotation and shear. If there are more than
3 GCPs the affine transformation will not be exact at all the control
points, so a best fit is computed. In that sense the geotransform
is approximate.
It will provide the same transformation effects as gdalwarp would have
up to the point where gdalwarp would start using a second order polynomial.
(6 gcps I believe) at which point gdalwarp will give a better geometric
transformation.
> Talking warp, when an image is warped with CS transformation, it is
> likely to be rotated and non rectangular anymore.
> Is there a way to access only the data bearing pixels of the warped image?
> In fact, if several warped images are shown together without caring
> about the no data part of the image, a black portion will appear and
> overlap with actual data.
I'm not exactly sure what you mean by "access" the pixels. If you use
the -dstalpha commandline switch to gdalwarp, it will add an alpha
transparency channel in the output file. This will be 0 (transparent)
for any pixels that were not copied from the source (the black rectangles
on the edges), or 255 for valid pixels.
Alternatively, if you use -dstnodata you can set a value to be burned into
the output file for pixels not copied from the source. By default this is
effectively 0 (black).
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