I am trying to rasterize a vector layer using the "rasterize tool" in QGIS... The problem is that there is no "attribute fields" available to choose from (even though they exist!)... print screen- attribute field field I want to rasterize

  • 1
    Two possible problems come immediately to mind. If you're dealing with a shapefile that is an invalid field name - can't have any spaces. The other is what datatype is that field? I believe it would have to be numeric to work (preferably int based on visible values), and it could currently be a string depending on how it was created. – Chris W Apr 16 '15 at 0:56
  • 1
    I agree with Chris, that's most likely to be the problem (either or both). It is possible that there are some issues with spatial reference. GDAL_Rasterize can use (and up to recently needed) an existing raster - if it exists ensure that the cell size suits the spatial reference of your data (or specify a different output that doesn't exist). – Michael Stimson Apr 16 '15 at 1:01
  • Thanks guys!!!!! ;) :D I edited my table in excell and the field I wanted to rasterize wasn't defined as numeric – Nadia Apr 16 '15 at 1:23

As you figured out, the column is not defined as 'Integer' or 'Real' type. You can use Field Calculator to add a new column of type integer and write an expression such as below to have a field you can use in conversion.

toint("TEXTURA LA")
  • 1
    also, as Chris pointed out, you can't have a field "TEXTURA LA" because of the space, you would need to change it to "TEXTURA_LA". Field calculator wouldn't like the space in the from field name so it's doubtful if that would run, if it did that would fix it. – Michael Stimson Apr 16 '15 at 5:28

I had a similar problem although the shapefile was ok. Going to "geoprocessing tools" and using the "gdal" "rasterize" directly instead of using the "rasterize" linked in the Qgis main menu (Raster>Conversions>Rasterize) solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.