Opened 15 years ago

Closed 15 years ago

#2993 closed defect (worksforme)

Out of memory reading small filtered VRT

Reported by: asgerpetersen Owned by: chaitanya
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: VRT filter
Cc: warmerdam

Description

I'm having trouble reading filtered VRTs. It has worked before, but I'm not sure at which version it stopped working.

Using trunk. FWTools 2.3.1 and 2.2.8 also fails.

A simple example using gdalinfo:

c:\gdalinfo --debug on -stats mergedfiltered.vrt
GDAL: GDALOpen(mergedfiltered.vrt, this=0325A958) succeeds as VRT.
Driver: VRT/Virtual Raster
Files: mergedfiltered.vrt
Size is 1875, 1875
Coordinate System is `'
Origin = (518000.000000000000000,6170000.000000000000000)
Pixel Size = (1.600000000000000,-1.600000000000000)
Corner Coordinates:
Upper Left  (  518000.000, 6170000.000)
Lower Left  (  518000.000, 6167000.000)
Upper Right (  521000.000, 6170000.000)
Lower Right (  521000.000, 6167000.000)
Center      (  519500.000, 6168500.000)
Band 1 Block=128x128 Type=Float32, ColorInterp=Undefined
GDAL: GDALOpen(merged.vrt, this=03258708) succeeds as VRT.
ERROR 2: Work buffer allocation failed.
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 2: VSIMalloc3(): Out of memory allocating 3465572 bytes.

ERROR 2: Work buffer allocation failed.
ERROR 1: IReadBlock failed at X offset 1, Y offset 0
ERROR 2: Work buffer allocation failed.
ERROR 1: IReadBlock failed at X offset 2, Y offset 0
ERROR 2: Work buffer allocation failed.
ERROR 1: IReadBlock failed at X offset 3, Y offset 0
ERROR 2: Work buffer allocation failed.
ERROR 1: IReadBlock failed at X offset 4, Y offset 0
ERROR 2: Work buffer allocation failed.
ERROR 1: IReadBlock failed at X offset 5, Y offset 0
ERROR 2: CPLMalloc(): Out of memory allocating 1382920 bytes.


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

The failing VRT applies a filter on top of another VRT which references nine 625x625 ESRI ASCII grids:

<VRTDataset rasterXSize="1875" rasterYSize="1875">
  <GeoTransform> 5.1800000000000000e+005, 1.5999999999999996e+000, 0.0000000000000000e+000, 6.1700000000000000e+006, 0.0000000000000000e+000,-1.5999999999999996e+000</GeoTransform>
  <VRTRasterBand dataType="Float32" band="1">
    <NoDataValue>-9.99000000000000E+002</NoDataValue>
    <KernelFilteredSource>
      <SourceFilename relativeToVRT="1">merged.vrt</SourceFilename>
      <SourceBand>1</SourceBand>
      <SourceProperties RasterXSize="1875" RasterYSize="1875" DataType="Float32" BlockXSize="128" BlockYSize="128"/>
      <Kernel normalized="1">
        <Size>7</Size>
        <Coefs>0.0012955664 0.0039355833 0.0076654696 0.009573013 0.0076654696
0.0039355833 0.0012955664 0.0039355833 0.011955246 0.023285641 0.029080246 
0.023285641 0.011955246 0.0039355833 0.0076654696 0.023285641 0.045354235 
0.056640585 0.045354235 0.023285641 0.0076654696 0.009573013 0.029080246 0.056640585 
0.07073553 0.056640585 0.029080246 0.009573013 0.0076654696 0.023285641 0.045354235 
0.056640585 0.045354235 0.023285641 0.0076654696 0.0039355833 0.011955246 
0.023285641 0.029080246 0.023285641 0.011955246 0.0039355833 0.0012955664 
0.0039355833 0.0076654696 0.009573013 0.0076654696 0.0039355833 0.0012955664 </Coefs>
      </Kernel>
    </KernelFilteredSource>
  </VRTRasterBand>
</VRTDataset>

Change History (4)

comment:1 by warmerdam, 15 years ago

Cc: warmerdam added
Component: defaultGDAL_Raster
Keywords: VRT filter added
Owner: changed from warmerdam to chaitanya

Chaitanya,

Please see if you can reproduce this problem and reach some sort of resolution.

comment:2 by chaitanya, 15 years ago

Status: newassigned

Petersen,

Can you provide the file 'merged.vrt' and ,if you can, the ascii grid files?

in reply to:  2 comment:3 by asgerpetersen, 15 years ago

Chaitanya,

I cannot publish the data here, so I have sent it to you in an email.

comment:4 by asgerpetersen, 15 years ago

Resolution: worksforme
Status: assignedclosed

All,

I am very sorry to have wasted your time. The error was completely on my side and not in GDAL. I am sorry about the noise.

Note: See TracTickets for help on using tickets.