1

I am running QGIS 3.4.4 With GRASS 7.4.4 and I get an error while rasterizing a vector layer and I don't know why. The same error pops up while using GDAL->Rasterize(vector to raster) and while using GRASS->v.to.rast. "The following layers were not correctly generated. < ul>< li> C:/Users/Viktor/Desktop/yes.png< /li>< /ul>" This happens when the option Open output file after running algorithm is checked, as when it is not, there are no errors but the file isn't created.

The start and end coordinates are not out of bounds. Output data type is (by default) Float32 and output format is .png (and I've tried Tiff as well but doesn't work). I have not touched the rest of the parameters.

However, one thing that should be noted is that the vectors come from a gdb folder that I drag-and-dropped into QGIS and it gave me the option to import layers so I did that. Could that be interfering with the renderer?

EDIT: While thinking about the problem, I just realized I can just look at the Error Log and this is the problem.... ERROR 1: Wrong value for -outsize parameter.

         Usage: gdal_rasterize [-b band]* [-i] [-at]

          {[-burn value]* | [-a attribute_name] | [-3d]} [-add]

          [-l layername]* [-where expression] [-sql select_statement]

          [-dialect dialect] [-of format] [-a_srs srs_def] [-to "NAME=VALUE"]*

          [-co "NAME=VALUE"]* [-a_nodata value] [-init value]*

          [-te xmin ymin xmax ymax] [-tr xres yres] [-tap] [-ts width height]

          [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/

          CInt16/CInt32/CFloat32/CFloat64}] [-optim {[AUTO]/VECTOR/RASTER}] [-q]

So I think this makes problem solving very much easier, I will try to find out myself but any further suggestions are welcome.

  • 1
    Have you tried converting that vector file to a shapefile first? Also if there are geometry errors in your file it could cause a problem. maybe try fixing geometries prior rasterizing. – B-C B. Feb 21 at 22:49
  • Lastly it doesn't seem to recognize WGS84. Try it with a metric Coodinate system like Albers – B-C B. Feb 21 at 22:56
  • @B-CB. I doubt that there are gometry issues as I downloaded the gdb folder off of ccm.jrc.ec.europa.eu/php/index.php?action=view&id=24. The rest of your suggestions, I do not understand. How would one convert this to a shapefile or use Albers? – VikiPedia Feb 22 at 17:00
  • To convert the data type and/or CRS of a vector layer: Right click on the layer name in the layer panel > Export > Choose desired datatype and CRS. – csk Feb 22 at 18:27
  • @csk I exported the vector to .shp but the same error still occurs. – VikiPedia Feb 22 at 19:18

Your Answer

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

Browse other questions tagged or ask your own question.