6

I'm trying to convert a polygon to raster. This error pops up:

ERROR 6: At least one of -3d, -burn or -a required.

What am I missing?

  • 2
    Did you select an attribute field (which is the -a parameter) from your polygon layer before trying to run the tool? – Joseph May 11 '17 at 11:20
  • 1
    i did not.. what does the -a parameter describe? – Leo May 11 '17 at 11:27
  • 2
    The parameters are described here: gdal_rasterize. The -a parameter is defined as: "Identifies an attribute field on the features to be used for a burn-in value. The value will be burned into all output bands.". Essentially, the tool requires a value from the polygon layer to be burned into the raster. The -3d parameter is currently only for points and lines so you don't need to use that. The -burn parameter allows you to use a single value instead of values in a field. – Joseph May 11 '17 at 11:30
  • 2
    ah okay I tried that and generated a attribute field with zeros only and one "1". That worked – Leo May 11 '17 at 11:37
  • 2
    Awesome, glad it worked! Will post the comment as an answer for the convenience of others :) – Joseph May 11 '17 at 11:46
7

The parameters for the gdal_rasterize are described in the following link:

http://www.gdal.org/gdal_rasterize.html

The parameters in your error are described as follows from the link:

  • -a attribute_name:

    Identifies an attribute field on the features to be used for a burn-in value. The value will be burned into all output bands.

  • -burn value:

    A fixed value to burn into a band for all objects. A list of -burn options can be supplied, one per band being written to.

  • -3d:

    Indicates that a burn value should be extracted from the "Z" values of the feature. As of now, only points and lines are drawn in 3D.

Essentially, the tool requires a value from the polygon layer to be burned into the raster. The -a parameter allows you to use values from an attribute field; -burn parameter allows you to use a single value instead of values in a field; -3d parameter is currently only for points and lines so you can ignore this one.

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.