#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 )
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 , 13 years ago
Description: | modified (diff) |
---|
comment:3 by , 13 years ago
60722x29444 is 1.7 GB. Perhaps you don't have enough memory for such a big allocation.
comment:4 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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?
- Use the new gdal_rasterize version, that allows raster creation. I really want a big raster for rasterizing it later, so, I guess it could work. And related with that, I tested that option, and compared it with the old-way new raster creation (http://trac.osgeo.org/gdal/wiki/FAQRaster#HowcanIcreateablankrasterbasedonavectorfilesextentsforusewithgdal_rasterizeGDAL1.8.0), and the resulting raster files were different. I'll read the gdal_rasterize code to see what approach was used in raster creation.
Anyway, I resolve the ticket as invalid, because it's not a GDAL problem.
Note:
See TracTickets
for help on using tickets.
The same problem with GDAL 1.7.3, and I forgot to say I'm using Ubuntu 10.04.