3

I have 6 point .shp files wich contain elevation data, the first 3 files are rather small (about 200MB for the shp and 1GB for the dbf) and the last 3 much larger (500MB .shp and 3.5GB for dbf). I would like to create filled polygons between the lines. The plugin "generate contours" is perfect for my needs.

Unfortunately, the tool only works for small files. When running the script with larger files I get the following error message.

QGIS-Version: 3.10.12-A Coruña QGIS-Codeversion: 75c848ffb1 Qt-Version: 5.11.2 GDAL-Version: 3.1.4 GEOS-Version: 3.8.1-CAPI-1.13.3 PROJ-Version: Rel. 6.3.2, May 1st, 2020 Verarbeite Algorithmus… Algorithmus Generate Contours startet… Eingabeparameter: { 'ContourInterval' : 2, 'ContourLevels' : '', 'ContourMethod' : 3, 'ContourType' : 1, 'DuplicatePointTolerance' : 0, 'ExtendOption' : 0, 'InputField' : '"zfield"', 'InputLayer' : 'C:/Users/denni/Desktop/462000_5520000_dgm1.shp', 'LabelDecimalPlaces' : -1, 'LabelTrimZeros' : False, 'LabelUnits' : '', 'MaxContourValue' : None, 'MinContourValue' : None, 'NContour' : 2000, 'OutputLayer' : 'TEMPORARY_OUTPUT' }

Triangulating 17936620 points Traceback (most recent call last): File "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGenerator.py", line 585, in filledContourFeatures trig,z=self.trigContourData() File "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGenerator.py", line 472, in trigContourData trig=self.buildTriangulation(x,y) File "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGenerator.py", line 462, in buildTriangulation trig=Triangulation(x,y) File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\matplotlib\tri\triangulation.py", line 54, in init self.triangles, self._neighbors = _qhull.delaunay(x, y) RuntimeError: Error in qhull Delaunay triangulation calculation: insufficient memory (exitcode=4); use python verbose option (-v) to see original qhull error.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGeneratorAlgorithm.py", line 326, in processAlgorithm for feature in generator.contourFeatures(): File "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGenerator.py", line 588, in filledContourFeatures raise ContourGenerationError.fromException(sys.exc_info()) contour.ContourGenerator.ContourGenerationError: ['RuntimeError: Error in qhull Delaunay triangulation calculation: insufficient memory (exitcode=4); use python verbose option (-v) to see original qhull error.\n']

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGeneratorAlgorithm.py", line 330, in processAlgorithm feedback.reportError(ex.message()) TypeError: QgsProcessingFeedback.reportError(): argument 1 has unexpected type 'list'

Ausführung nach 23894.76 Sekunden gescheitert

Lade Ergebnis Layer Algorithmus 'Generate Contours' beendet

It says "insufficient memory" but I still have 71GB on my hard drive. It should be enough shouldn't it. I do have "only" 8GB RAM, perhaps that's not enough. Does anyone have any ideas on what I could do to make it work?

I'm using QGIS 3.10.12

3
  • 1
    it is referring to memory not disk space - try adding some swap space
    – Ian Turton
    Commented Apr 11, 2021 at 9:35
  • I don't know what swap space is to be honest but I'm researching about it right now. Is it somehow possible to tell QGIS to write Data on my hard drive rather than my memory? I wouldn't mind if the Tool takes much longer.
    – DGIS
    Commented Apr 11, 2021 at 10:37
  • that's what swap space is
    – Ian Turton
    Commented Apr 11, 2021 at 10:59

2 Answers 2

4

I would recommend a different approach that should work a lot better. To start off with, I would not use QGIS 3.10.12 anymore. Please upgrade to 3.16 or 3.18 and you will notice significant improvements in processing.

  1. Load the point data into QGIS.
  2. Create a raster from the point dataset. You can try the following tools: Rasterize (vector to raster) or any of the "Grid" tools (tin, idw, nearest neighbour, linear) depending on your dataset. You will get a .tif raster layer from this, you may need to clip it a bit to get it correctly on your location.
  3. Run the "Contour Polygons" tools in QGIS. This will give you a .shp contour output.

This approach does not involve any plugins and is much better on your computers resources.

Editing this response to mention that my environment produces results extremely slowly if the .gpkg format is used for writing contours. I suggest using .shp and then saving the .shp as .gpkg if required as a second step.

1
  • Changeing the memory size was an interesting information. I learned something new about windows but your workaround solved my problem!
    – DGIS
    Commented Apr 17, 2021 at 12:24
1

Increase virtual memory on your computer (if possible, some organisations won't allow you to do this, you will have to go through a system administrator within your organisation).

Here is a link with instructions on how to do it.

https://www.windowscentral.com/how-change-virtual-memory-size-windows-10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.