Bug report #12695

GDAL Rasterize does not rasterize vectors with field 0

Added by Paolo Cavallini over 4 years ago. Updated over 4 years ago.

Status:Closed
Priority:Normal
Assignee:Giovanni Manghi
Category:Processing/GDAL
Affected QGIS version:2.8.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:20801

Description

All records are rasterized, except those with value of the selected field = 0. This seems inappropriate

History

#1 Updated by Giovanni Manghi over 4 years ago

  • Status changed from Open to Feedback
  • Assignee changed from Victor Olaya to Giovanni Manghi

Cannot confirm on qgis master. Please attach sample data.

#2 Updated by Paolo Cavallini over 4 years ago

Done with the basins from exercise data.
Thanks.

#3 Updated by Giovanni Manghi over 4 years ago

Paolo Cavallini wrote:

Done with the basins from exercise data.
Thanks.

if you mean the training manual exercise data then I cannot see any "basins" layer. Better attach the data is giving you problems.

#5 Updated by Giovanni Manghi over 4 years ago

I tested on both QGIS master and 2.8.1 on both Linux and Windows and in all cases, with the provided vector, there are no issues and the polygon with attribute = 0 are correctly rasterized to pixels with value = 0.

If you use the tool and choose "byte" as type for output you must pay attention to the value used for nodata, as -9999 cannot fit in such type and so it is automatically changed to 0.

#6 Updated by Paolo Cavallini over 4 years ago

Got it, thanks. Perhaps a better default could be chosen for nulls?

#7 Updated by Giovanni Manghi over 4 years ago

maybe is better to change the default type to int16?

#9 Updated by Paolo Cavallini over 4 years ago

  • Resolution set to fixed/implemented
  • Status changed from Feedback to Closed

Also available in: Atom PDF