7

I have a raster whose pixel values are 0 or 1 (b/w areas in the image below) and data type is Float32.

I made a point layer from each individual pixel's center. Then I made some calculation for all points and added it as new field.

enter image description here

How can I make a new raster, which has the same properties (resolution, pixel size, data type, etc.) with the first raster, from those point values?

  • 3
    Have you tried gdal_rasterize yet?: gdal.org/programs/gdal_rasterize.html – Aaron Sep 13 at 17:37
  • @Aaron my ultimate goal is to assign point values to existing pixels. Since I want to try another ways, I have asked the question this way. I couldn't use gdal_proximity. I'm getting errors. But It looks like I will try to solve my problem by writing code instead of fixing errors. – Kadir Şahbaz Sep 13 at 19:22
  • 5
    +1 for gdal_rasterize which is available as the Rasterize tool in the QGIS Processing toolbox. You can specify the same extent and cellsize as your existing raster. – user2856 Sep 14 at 6:02
0

The best solution I can think of is the inverse distance weighting (IDW) algorithm.

If you're having difficulty understanding the algorithm then this tutorial should help you out.

https://www.qgistutorials.com/en/docs/interpolating_point_data.html

| improve this answer | |
  • 1
    The rasterize of processing might be better, since it will honour a one to one value (burn) a new value and not do an interpolation. – Jakob Nov 9 at 12:13
  • That's very true. But in a situation where you want the output raster resolution to be higher than the original raster resolution then IDW might be a better option. Someone might find this useful. – GeoAfrikana 2 days ago

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.