[gdal-dev] Rectify TIFF: Difference between applied GCP and warped image

Even Rouault even.rouault at spatialys.com
Fri Apr 15 02:27:36 PDT 2016


>         An excellent text, with well explained equations, for your purposes
> may be "Map Projection Transformation: Principles and Applications" by Qihe
> Yang, John P Snyder and Waldo R Tobler and published by Taylor & Francis in
> 2000.   Snyder's introductions to map projections are generally available
> for download from USGS.

In that instance, map projections are not relevant since the warping done by 
Richard doesn't involve any.

Without the source image and the ESRI generated image, it is difficult to assess 
if something is really wrong and how much both images are different. One  
difference shown from the gdalinfo reports is the selection of the output 
resolution (there's a recent ticket about that in Trac : 
https://trac.osgeo.org/gdal/ticket/6320), but that's more or less an arbitrary 
choice that shouldn't affect the georeferencing. Other differences could come 
from the way polynomial coefficients are computed. GDAL uses least square 
adjustment, but I guess everyone does that.
I'm not aware of issues having been reported against the GDAL code with 2nd 
order polynomial (contrary to 3rd order where there are likely implementation 
issues).
Regarding truncation of the input rather, this might be due to insufficient 
sampling step when walking along the edges of the input raster. Adding -wo 
SAMPLE_STEPS=x with x > 21 (for example to 100) might help, possibly with -wo 
SAMPLE_GRID=YES ( see 
http://www.gdal.org/structGDALWarpOptions.html#a0ed77f9917bb96c7a9aabd73d4d06e08 
). Having to use that is a sign that the warping involves non neglectable non-
linear warping.
Fine tuning of the target extent with -te is also a possibility.

> 
> Enjoy!
> 
> Peter
> 
> On 15 April 2016 at 08:27, Jukka Rahkonen <
> 
> jukka.rahkonen at maanmittauslaitos.fi> wrote:
> > Bischof, Richard <Richard.Bischof <at> lgln.niedersachsen.de> writes:
> > > Hi Jukka,
> > > 
> > > you're correct. ArcMap is doing the on-the-fly transformation with the
> > 
> > dataset, I applied the gcps using
> > 
> > > gdal_translate to.
> > > With both gdal_warp and ArcMap Rectify I use second order polynomial.
> > > 
> > > I also found, that some areas of my source image are cut out from the
> > 
> > gdal_warp destination dataset.
> > 
> > 
> > Hi,
> > 
> > I can't really help you but because I do not understand warping
> > algorithms. If ArcMap and GDAL makes different output with 2nd order
> > polynomial and with
> > the same gcp set I can see three alternatives:
> > 
> > 1) GDAL is wrong
> > 2) ArcMap is wrong
> > 3) There are different interpretations about what should happen and both
> > are
> > right, or wrong.
> > 
> > I suppose that what GDAL is doing is written in
> > https://trac.osgeo.org/gdal/browser/trunk/gdal/alg/gdaltransformer.cpp
> > I fear we do not have the code used by ArcMap available for making a
> > comparison.
> > 
> > Can you simplify the case into a question like:
> > With this gcp set, applied to an image of sixe xxx(W) by yyy(H) pixels,
> > after 2nd order polynomial transformation with GDAL the source pixel (x1,
> > y1) is moved into location (x2, y2) in pixel space, and (xxx(E), yyy(N))
> > in projected cooordinates in EPSG:xxxx.
> > 
> > ArcMap moves this pixel into (x2', y2') (xxx'(E), yyy'(N)) and I think
> > than one or the other is wrong. What do warping specialists think?
> > 
> > -Jukka Rahkonen-
> > 
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list