1

I have a geopackage consisting of 16x16m squares, which hold data within them. I wish to convert said data into a raster format to be used elsewhere. When rasterizing, however, the output file is blank, as all RGBA values are 0 and is showing the entire float32 spectrum (which is, again, blank).

I found a similar problem but their fix doesn't apply here. I also got suggestions that maybe the pixelsize I was going for was too large, but going smaller didn't help. An alternative suggestion was made to take the centroids of each square and interpolate between the points. This is a horrible idea as it at times gives false values for certain areas.

The geopackage itself can be downloaded here if you're willing to give it a go.

Specifically I am trying to make it so that each 16x16 square is a single pixel. And the CRS is EPSG:5048

1 Answer 1

4

It seems the geopackage format is causing a problem. If you export your file to a shapefile format and then open the attribute table, you will notice that the numbers in the V_MA field have very long decimal values.

enter image description here

Create a new field, name it V_MA2 of type real, and decimal values equal to 2. Then, make a copy of the V_MA field using the field calculator.

Then, use the V_MA2 field to convert to raster.

Here is the information in the image below:

enter image description here

enter image description here

  • Input file: test.shp
  • Field to use: V_MA2
  • Output raster size: Georeferenced units
  • Width/horizontal resolution: 16
  • Height/Vertical resolution: 16
  • Extent: select test layer
  • Output data type: Float32
  • Rasterized: here, I used the *.img format

Here is the output raster:

enter image description here

1
  • Yup, this fixed the issue, Thanks! Commented Mar 29 at 19:39

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.