[GRASS-user] Error in r.in.gdal: CPLCalloc(): Out of memory allocating for "EHdr/ESRI .hdr Labelled" driver

Patton, Eric epatton at nrcan.gc.ca
Wed Apr 11 14:24:05 EDT 2007


I'm trying to import a pile of Arc floating point binary rasters (.flt and .hdr extensions) with r.in.gdal:


$ r.in.gdal input=45_18_N_66_06_W_BACKSCATTER.flt output=45_18_N_66_06_W -oe
WARNING: Over-riding projection check.
ERROR 2: CPLCalloc(): Out of memory allocating -329 bytes.

Aborted (core dumped)


AFAIK, these rasters are in New Brunswick Double Stereographic projection (EPSG 2953), and I've already set up the current location with these projection parameters. gdalinfo doesn't seem to have a problem identifying the files:

$ gdalinfo 45_18_N_66_06_W_BACKSCATTER.flt

Driver: EHdr/ESRI .hdr Labelled
Size is 2641, 3721
Coordinate System is `'
Origin = (2531369.500000000000000,7366720.500000000000000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Corner Coordinates:
Upper Left  ( 2531369.500, 7366720.500) 
Lower Left  ( 2531369.500, 7362999.500) 
Upper Right ( 2534010.500, 7366720.500) 
Lower Right ( 2534010.500, 7362999.500) 
Center      ( 2532690.000, 7364860.000) 
Band 1 Block=2641x1 Type=Byte, ColorInterp=Undefined
  NoData Value=255
  Metadata:
    NBITS=-


I'm using a fresh install of GDAL 1.4.1, along with a fresh 6.3 cvs update from today. I see that at 1m resolution, the output raster would be 9,827,161 cells in size - pretty big. Is this the source of the CPLCalloc error? 

Can anything be done as a workaround, i.e., using gdal tools to reduce the resolution of the output raster on the fly? I have 350 of these rasters to import.

Thanks,

~ Eric.




More information about the grass-user mailing list