[gdal-dev] gdalwarp performance with many GCPs
Knut-Frode Dagestad
knutfrodesoppel at hotmail.com
Wed Dec 12 06:38:16 PST 2012
On 12. des. 2012 14:16, Jan Hartmann wrote:
> It's far too slow here too, so it's not your build.
>
> I see that the warp itself doesn't start but after a very long time, so
> the problem lies in the initial computation of the transformation
> matrix. It must have something to do with the distribution of points,
> perhaps too close together, so as to cause singularities. The target
> coordinates are latlon-values, very close numerically. I see two testing
> possibilities:
>
> 1) Try to warp with subsets of points
> 2) Multiply all target coordinates with (e.g.) 1000. You'll get an
> impossible georeference, but if this goes much faster, you know where
> the problem lies.
>
> Jan
>
Scaling lon and lat with 1000 did not help, but when using only every
5th GCP in each direction it is very fast (3 seconds with -tps) and
still with good accuracy (as long as I keep the border GCPs).
So thank you, Jan, for spotting the problem!
It might be useful with a -decrease-GCP-density-factor switch which the
user could fine-tune for performance, or ideally that the warping
routines would calculate the optimal factor directly.
Another thing: I originally wanted to warp using Python API
(AutoCreateWarpedVRT), but it seems to have no option to use -tps (?) -
so therefore I have to call gdalwarp as system command.
Knut-Frode
More information about the gdal-dev
mailing list