Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#3844 closed defect (invalid)

MemoryError in band function WriteRaster

Reported by: jorgearevalo Owned by: hobu
Priority: normal Milestone:
Component: PythonBindings Version: 1.6.3
Severity: major Keywords: memory error python
Cc: jorgearevalo

Description (last modified by jorgearevalo)

I'm getting a memory error in python binding:

Traceback (most recent call last):
  ...
  File "/usr/lib/python2.6/dist-packages/osgeo/gdal.py", line 859, in WriteArray
    return gdalnumeric.BandWriteArray( self, array, xoff, yoff )
  File "/usr/lib/python2.6/dist-packages/osgeo/gdal_array.py", line 167, in BandWriteArray
    array.tostring(), xsize, ysize, datatype )
MemoryError

With GDAL 1.6.3, Python 2.6

I was creating a big blank raster (60722x29444 px), to apply gdal_rasterize over it. I know since GDAL 1.8.0 gdal_rasterize creates the raster dataset, but I can't use it.

Change History (5)

comment:1 by jorgearevalo, 13 years ago

Description: modified (diff)

The same problem with GDAL 1.7.3, and I forgot to say I'm using Ubuntu 10.04.

comment:2 by jorgearevalo, 13 years ago

Seems to be a problem of zeros numpy function

comment:3 by Even Rouault, 13 years ago

60722x29444 is 1.7 GB. Perhaps you don't have enough memory for such a big allocation.

comment:4 by jorgearevalo, 13 years ago

Resolution: invalid
Status: newclosed

Yep. The same code works in a 64bits machine. If I want to run it in a 32bits machine, I see 2 solutions:

  • Create a tiled raster file? Like when you provide TILED=YES in gdal_translate, but creating the new file from scratch, not from another one. Possible?

Anyway, I resolve the ticket as invalid, because it's not a GDAL problem.

comment:5 by Even Rouault, 11 years ago

Milestone: 1.6.4

Milestone 1.6.4 deleted

Note: See TracTickets for help on using tickets.