[gdal-dev] Memory error for gdal_grid if using nearest

Even Rouault even.rouault at spatialys.com
Thu Jul 16 16:20:21 PDT 2015


On Thursday 16 July 2015 21:03:52 Armin Schmidt wrote:
> I have a very simple point-shapefile which throws various memory
> allocation errors when I try to grid it with gdal_grid using "nearest",
> but works absolutely fine and fast when using the "invdist" algorithm. I
> never had this problem before. Does anyone have any idea what is wrong?
> If it would help I can provide the shapefile.

Armin,

That could be useful indeed. From your description, it looks like the building 
of the spatial index would went wrong with this particular dataset, looping 
forever or something like that and ending up eating all the memory.

Even

> 
> The stripped down command-line is:
> 
> gdal_grid.exe 02VHiDep_raw.shp test.tif -ot Float32 -of GTiff -zfield
> Cond1_mSm -l 02VHiDep_raw -a nearest
> 
> After taking some time (probably searching for the nearest neighbours),
> this throws:
> 
> ERROR 1: CPLMalloc(): Out of memory allocating 64 bytes.
> FATAL: CPLMalloc(): Out of memory allocating 64 bytes.
> ERROR 1: TIFFWriteDirectorySec:Out of memory
> ERROR 2: Cannot allocate 8192 bytes
> ERROR 1: TIFFWriteDirectorySec:Out of memory
> ERROR 1: TIFFWriteDirectorySec:Out of memory
> 
> Grid data type is "Float32"
> Grid size = (256 256).
> Corner coordinates = (449675.737076 6895223.317256)-(449705.249717
> 6895209.690215).
> Grid cell size = (0.114835 0.053024).
> Source point count = 3280.
> Algorithm name: "nearest".
> Options are
> "radius1=0.000000:radius2=0.000000:angle=0.000000:nodata=0.000000"
> 
> Armin

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


More information about the gdal-dev mailing list