0

enter image description hereWhen 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.

5
  • 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?
    – Vince
    Commented Feb 1 at 18:24
  • @Vince There is NODATA values, my question is how can I get cero values instead of NODATA?
    – user
    Commented Feb 1 at 19:14
  • Is it 1-bit? Maybe you could set the NODATA to be -1 or 2
    – Vince
    Commented Feb 1 at 19:15
  • 1
    I would perhaps set the output type into byte (8 bit) and set the nodata value into 255.
    – user30184
    Commented Feb 1 at 19:28
  • @user30184 Thank you so much your solution works
    – user
    Commented Feb 1 at 19:53

1 Answer 1

1

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.

1
  • 4-bit would take half the storage (but would require a 15 NODATA)
    – Vince
    Commented Feb 1 at 22:04

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.