QGIS – Troubleshooting Contour Generation with DEM TIFF File

contourdemgdal-contourlidarqgis

First a note about previous data processing. My original data (from a LIDAR scan) is a text .asc file with the internal structure looking like this:

457758.77;110272.34;353.89
457758.77;110273.34;353.77
457758.77;110274.34;353.48
457758.77;110275.34;353.21
457758.77;110276.34;352.79
...

I can't import the data directly to QGIS as it doesn't recognize the format. So I used CloudCompare to convert the point cloud data to a DEM tiff image, available here: uncompressed smarna.tiff (69 MB) or compressed smarna.7z (10 MB).

When I import the generated tiff image in QGIS it correctly renders the shaded elevation profile, and can even render as contours using "Symbology -> Band Rendering -> Contours" in the layer properties.

However, when I try to generate a contour layer with "Raster -> Extract -> Contour", the resulting contours layer is empty. This is the log output of the contour tool:

QGIS version: 3.22.2-Białowieża
QGIS code revision: 1601ec46d0
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.4.0
GEOS version: 3.10.0-CAPI-1.16.0
PROJ version: Rel. 8.2.0, November 1st, 2021
PDAL version: 2.3.0 (git-version: 9f35b7)
Algorithm started at: 2022-01-13T09:34:50
Algorithm 'Contour' starting…
Input parameters:
{ 'BAND' : 1, 'CREATE_3D' : False, 'EXTRA' : '', 'FIELD_NAME' : 'ELEV', 'IGNORE_NODATA' : False, 'INPUT' : 'C:/Users/shrx/Documents/smarna.tif', 'INTERVAL' : 10, 'NODATA' : None, 'OFFSET' : 0, 'OUTPUT' : 'TEMPORARY_OUTPUT' }

GDAL command:
gdal_contour -b 1 -a ELEV -i 10.0 -f "GPKG" C:/Users/shrx/Documents/smarna.tif C:/Users/shrx/AppData/Local/Temp/processing_cTjhKy/c4de41f5a33347bb9197b9f6886eec54/OUTPUT.gpkg
GDAL command output:
0...10...20...30...40...50...60...70...80...90...100 - done.
Process completed successfully
Execution completed in 1.47 seconds
Results:
{'OUTPUT': 'C:/Users/shrx/AppData/Local/Temp/processing_cTjhKy/c4de41f5a33347bb9197b9f6886eec54/OUTPUT.gpkg'}

Loading resulting layers
Algorithm 'Contour' finished

The layer information shows that the generated contour file for 10 m elevation interval is ~5 MB large and has 1439 "features", however no contour lines are visible in QGIS.

Here is the generated contour file: uncompressed OUTPUT.gpkg (5 MB) or compressed OUTPUT.7z (1 kB).

Best Answer

I downloaded your contour geopackage. Open it with QGIS, right click the layer -> Layer CRS -> Set Layer CRS -> Search for "3912" -> OK

Your contour lines should be where you want them

enter image description here

Related Question