mkondratyev85 / raster_tracer

MIT License
65 stars 9 forks source link

Uncaught MemoryError: Unable to allocate 68.0 GiB for an array with shape (260393, 280391) and data type uint8 #28

Closed Almavin closed 3 years ago

Almavin commented 3 years ago

Steps to reproduce

  1. First
  2. Second
  3. Third
Traceback (most recent call last):
  File "C:/Users/Nzumi/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\raster_tracer\raster_tracer.py", line 243, in run
    self.tool_identify.raster_layer_has_changed(self.dockwidget.mMapLayerComboBox.currentLayer())
  File "C:/Users/Nzumi/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\raster_tracer\pointtool.py", line 230, in raster_layer_has_changed
    QgsProject.instance(),
  File "C:/Users/Nzumi/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\raster_tracer\utils.py", line 57, in get_whole_raster
    band1 = np.array(ds.GetRasterBand(1).ReadAsArray())
  File "C:\PROGRA~1\QGIS 3.14\apps\Python37\lib\site-packages\osgeo\gdal.py", line 2699, in ReadAsArray
    callback_data=callback_data)
  File "C:\PROGRA~1\QGIS 3.14\apps\Python37\lib\site-packages\osgeo\gdal_array.py", line 373, in BandReadAsArray
    buf_obj = numpy.empty([buf_ysize, buf_xsize], dtype=typecode)
MemoryError: Unable to allocate 68.0 GiB for an array with shape (260393, 280391) and data type uint8

raster_tracer 0.3.0, QGIS 3.14.16-Pi on Windows 10

mkondratyev85 commented 3 years ago

I'm afraid the raster map you're trying to trace over is way too large for this plugin. I would suggest you to divide it into smaller parts.