23

I would like to modify a raster (pixel values) in QGIS.

The plugins "value tools" can easily provide me with the value of the pixel of my raster. However I don't know how to modify it.

I have found the Q&A titled Manually correcting raster DEM (OpenSource)? which says that it is possible to do it in GRASS. I'v spent several hours on trying to understand how grass works without success.

I can't find the d.rast.edit tool in the sextante plugin.

Is there another way to acess it?

0

8 Answers 8

19

Since this is the #1 Google result for 'qgis raster editing' at this time, I thought I'd add that there is now the 'Serval' plugin that lets you modify pixels much like in Paint.

How to use: https://github.com/erpas/serval/wiki

0
7

Update: there is this easy way:

  1. make point layer with points over pixels you want change. With column called "newvalue"
  2. Use Raster / Conversion / Rasterize
    • select you point layer, field "newvalue"
    • as target use your raster/grid.
    • keep existing size and resolution

Done!

If there are applicable rules than as it was mentioned in other answers there is Raster Calculator.

If you can't use d.rast.edit (as mentioned in linked thread) I am not aware of any visual tool of to do it manually. The workaround is to export raster to ASCII Gridded XYZ (*.xyz) (or other text format) so you can edit it in text editor where you find your x/y and change the z.

There is also paid software called Leveler (http://www.daylongraphics.com/products/leveller/) - raster/grid visual editor which allow to modify surface in "Simcity" style. I haven't found any free tool for that.

1
4

SAGA GIS allows you to edit pixel values in a raster, one at a time. This is very useful for some purposes, e.g. remote sensing where you might what to select a specific pixel for spectral analysis. If you select the grid that you want to edit in the 'manager' panel, select the 'attributes' tab in the properties panel, and you can select a single pixel, or drag and select a block of pixels on screen, and then type in their values into the matrix that will be displayed under the attributes.

An option modify one pixel at a time with QGIS is to use the experimental plugin Serval to set a different value to a specific pixel.

4

Try this: The Serval plugin for QGIS allows editing values of a single raster cell.

http://www.lutraconsulting.co.uk/blog/2016/09/05/serval/

But I'm searching a tool to modify raster values along a line/polyline with values at ends of lines/polyline taken from raster.

1
  • 2
    Welcome to GIS SE! Is this an answer, a question, or both?
    – Aaron
    Commented Jun 15, 2017 at 11:49
3

Or using ThRasE Qgis plugin designed for that.

Disclosure: I developed this plugin, and I don't want to promote it, I just want to share another option

0
2

You can use the Raster Calculator in QGIS. This tutorial was a big help for me:

http://spatialgalaxy.net/2012/01/25/using-the-qgis-raster-calculator/

1
  • 1
    Thank for this tutorial. However, it might be a little tricky to use this tool just to modify few pixels !
    – Renaud
    Commented Nov 14, 2012 at 8:56
2

If you want to do this by code you can use the GDAL library :

http://gdal.org/classGDALRasterBand.html#a5497e8d29e743ee9177202cb3f61c3c7

1
  • I can't wait the plugin using this command of the gdal library to get a UI to modify a raster. It is funny to see how many tool exists to modify a vector layer and nothing for raster !
    – Renaud
    Commented Nov 14, 2012 at 8:59
1

You can only remap one value at a time with Raster Calculator and it doesn't let you specify the value type of the raster; it uses float 32 I think, which wasteful if just a byte is required. Rastercalc is better, but still only allows you to remap one value at a time.

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.