[GIS] gdal_grid performance issue — alternatives

gdalpython

I use gdal_grid within a Python script, but for my large files the calculation time is enormous. Apparently this is a gdal_grid issue http://trac.osgeo.org/gdal/ticket/2411

Does anyone have an advice / some code which can serve as a simple alternative to gdal_grid?

Best Answer

I am using gdal_grid to generate rasters from point data using Python. Right now I am dealing with the same issue as you do, so I am testing as much as I can before taking my chance with another library.

My advice would be to use the options for multiple cores and as much cache as you can give.

--config 'NUM_THREADS=ALL_CPUS GDAL_CACHEMAX=2000'

The gdal grid does not have an option to let you allocate as much memory as you wish. I would like to see if this increases performance or not.

If you are using "invdist" interpolator, it is best not to use a search radius because you will add a spatial filter. This is explained in the code. You can check it here

https://svn.osgeo.org/gdal/trunk/gdal/alg/gdalgrid.cpp

The interpolator config should look like this:

-a invdist:power=2.0:smoothing=0.0

I am about to test the -clipsrc option to limit the output raster to the region of interest since my polygons are not uniform.

I am using a i7 (3.6GHz) with 8GB of memory. My input data has less than 200.000 features, 16bits values, and the interpolation time is about 3 min.

Related Question