Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

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

I have found this tread saying it is possible to do it in Grass. thread I'v spent several hours on trying to understand how grass works. To complex for me...

Is it possible to access the d.rast.edit. tool from another way ? (can't find it in the sextant plugin.

Thank you for your help.

share|improve this question
    
Do you always want to edit one specific pixel at a time? Or do you want to change according to some rules? –  underdark Nov 13 '12 at 11:29
1  
I want to edit one specific pixel at a time –  Renaud Nov 18 '12 at 17:19

4 Answers 4

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

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

share|improve this answer
    
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 Nov 14 '12 at 8:59

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/

share|improve this answer
1  
Thank for this tutorial. However, it might be a little tricky to use this tool just to modify few pixels ! –  Renaud Nov 14 '12 at 8:56

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.