When I try to rasterize a Boolean vector file in QGIS I just get the ones values, what can I do to get both values (0,1)? There is no "nodata" values in the file.
-
Presence/absence has to have an absence code (aka 0). Rasters are inherently continuous (mutually exclusive, exhaustively complete). Are you sure there isn't a NODATA code?– VinceCommented Feb 1 at 18:24
-
@Vince There is NODATA values, my question is how can I get cero values instead of NODATA?– userCommented Feb 1 at 19:14
-
Is it 1-bit? Maybe you could set the NODATA to be -1 or 2– VinceCommented Feb 1 at 19:15
-
1I would perhaps set the output type into byte (8 bit) and set the nodata value into 255.– user30184Commented Feb 1 at 19:28
-
@user30184 Thank you so much your solution works– userCommented Feb 1 at 19:53
Add a comment
|
1 Answer
The resulting file would contain 3 distinct raster values: 0, 1, and some third value for presenting the nodata.
I suggest creating the output as an 8 bit raster. It has place for 256 distinct values. Use 0 and 1 for the data and for example 255 for the nodata.