QGIS-Documentation
QGIS-Documentation copied to clipboard
Rasterisation gives nodata values for 0
Description
The Rasterise operation does not immediately give back the all_conditions_simple raster. Indeed the value 0 is understood as nodata and is displayed as such.
In order to really get the same raster, displayed in the same way, I had to deselect No data value in the Transparency tab
and I had to change the min of the gray band to 0 instead of 1.
Why is 0 in the vector layer translated to nodata ?
Page URL: https://docs.qgis.org/3.28/en/docs/training_manual/complete_analysis/raster_to_vector.html#moderate-fa-the-raster-to-vector-tool
I have the answer to my question : the way the tutorial is set, the value 0.00000 is automatically given to GDAL as a nodata value. So one needs to remove it before run.
@dlejay Mind sharing your all_conditions_simple.tif layer you obtained, please? I'd like to update the page (and address this issue) but no time to go through the whole process of previous lessons. Thanks in advance.
I can't upload a .tif directly on Github, so here is a .png instead
The following raster is what I obtain after :
- Using the GDAL aspect algorithm with a flat default value of 0° (contrarily to what the tutorial currently asks) ;
- Using the rest of the conditions of the tutorial
((aspect@1 <= 90 OR aspect@1 >= 270) AND slope@1 <= 5) OR slope@1 <= 2
- Using the GDAL sieve algorithm with an 8 threshold and 8-connectedness (as demanded by the tutorial).
I can't upload a .tif directly on Github
Maybe within a zip file? Or you meant it is too heavy?
I'm trying to use the PNG. Applying the polygonize algorithm to it, I get a vector file that is the symmetric output 😢 . If someone knows how to fix/workaround...