[gdal-dev] gdalwarp performance with many GCPs

Knut-Frode Dagestad knutfrodesoppel at hotmail.com
Wed Dec 12 04:12:49 PST 2012


Hi list,

When warping images with many GCPs, the -tps switch (Thin Plate Spline) 
is found to be necessary to get decent accuracy. This makes however 
warping very slow. The only method I found to increase speed is the -et 
switch, but at cost of spatial accuracy.


Below some comments about the other tries which did not help:

- compiling GDAL with armadillo support had no effect on speed.
Btw, to compile with armadillo I had to manually insert -llapack in the 
following line in configure:
if test -z "`${CXX} testarmadillo.cpp -o testarmadillo -larmadillo 
2>&1`" ; then .....
Perhaps ${LIBS} should be added permanently to this line in trunk?

- compiling GDAL with OpenCL had also no effect. At first surprising, 
but looking at the opencl warp kernel it seems that it only makes a 
difference for other resampling algorithms than nearest neighbour?

- Increasing  memory with -wm had no effect

- Using several threads (-multi -wo NUM_THREADS=ALL_CPUS) actually 
increased computing time significantly (my proj version is 4.7.1).

 From the debug output, a lot of the time is apparently spent on:
"WARP: Copying metadata from first source to destination dataset"
Is this an indication that much time is simply spent on reading and 
writing the GCPs to/from file? If so, we could perhaps expect improved 
performance if Geolocation Arrays could be used instead (not possible 
due to http://trac.osgeo.org/gdal/ticket/4907).


The tests are made with the following file and command on Ubuntu:
http://dl.dropbox.com/u/15885758/testgcp.tif  (3212 GCPs and 2048x2511 
pixels covering Southern Europe)

time gdalwarp --debug on -et 5 -tps -t_srs '+proj=merc' testgcp.tif 
out.tif  (+ other swithces mentioned above)


Best regards from Knut-Frode



More information about the gdal-dev mailing list