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 need help... I'm having problems with QGIS. I have some rasters that appear to have null values, even though I reclassified them to obtain a boolean raster :( How can I change the NULL values to 0?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

beside @R.K. answer, you can use r.null in grass too.

r.null - Manages NULL-values of given raster map.

EXAMPLES

Set specific values of a classified map to NULL:

r.null map=landcover.30m setnull=21,22

Set NULL-values of a map to a specific value:

 r.null map=fields null=99

i hope it helps you...

share|improve this answer
add comment

I think the RasterCalc plugin should be able to solve your problem. Once you've installed it, you can use the following query (assuming that NULL values corresponds to -9999; you can check this value in Transparency tab of the Layer Properties):

eq( [your_raster]@1, -9999, 0 )

eq means equal to. This tells RasterCalc that all pixels in your raster with NULL values should have their values set to 0. I'm assuming you have a single band raster.

share|improve this answer
    
I will try it THANKS!!! –  Nadia Sep 19 '12 at 5:53
    
This doesn't seem to work (QGIS 1.8 / Rastercalc 0.2.5) - giving "expression invalid" with a loaded raster, e.g. eq( EL_hm@1, NULL, 0 ) –  Simbamangu Nov 10 '12 at 4:35
    
@Simbamangu, if you will use actual value used as NULL (-9999 for example) - this will work. e.g eq( EL_hm@1, -9999, 0 ) –  SS_Rebelious Mar 6 '13 at 20:47
    
@SS_Rebelious - you might want to mention in your edit that the NULL value can be set in the preferences (General|Representation for NULL values) and this should be reflected in the expression. –  Simbamangu Mar 7 '13 at 4:53
add comment

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.