Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've started to use Qgis recently. I have a logical question. I'm trying to reclassify a raster. The values in the raster are depths, obtained by an interpolation. The original depth values (of the vector) are: 1 = <30° 2 = 30°-60° 3 = >60° after the interpolation with IDW I get a set of continuous values and I need to convert them into discrete ones. If I round up/down the continuous values I will obtain an over-estimation of the central values (2) Is there a better (more logical) method to reclassify this values?

share|improve this question
Interpolating censored data like this is quite problematic, IDW is really meant for continuous data. Do you have a particular reason for using that interpolation technique? One possibility to deal with this would be to use nearest-neighbour interpolation to assign data values to locations without observations. Or you could interpolate the midpoints of your category ranges instead of the category codes themselves (so assign your points values of 15°, 45° and 75°, run your interpolation on that, and classify the resulting raster). – Jake Feb 11 '13 at 13:25
Thank you very much for your suggestions. I've used IDW because I though it was the best for my problem, but I don't have so much experience in GIS. – Antonio Feb 11 '13 at 17:14

We may view 1, 2, 3 as coarse representations of the original depths where 1 represents 15 degrees, 2 is 45 degrees, and 3 is 75 degrees (all to within plus or minus 15 degrees). To coarsen the IDW results in the same way, note that 30 degrees would translate to a coarse value of 1.5 (halfway between 15 and 45 degrees) and 60 degrees would translate to 2.5. Therefore, simply add 0.5 and truncate the result. This is readily done in the QGIS raster calculator using an expression like

int(mygrid + 0.5)

By checking the special cases 1.5 and 2.5 it is clear that all interpolated values less than 1.5 will be reclassified to 1 and all interpolated values greater than or equal to 2.5 will be reclassified to 3.

As Jake points out in a comment, these data are so coarse that the results won't be very accurate. Using other forms of interpolation won't help much. Interpolating the midpoints will make no difference whatsoever because replacing 1 by 15, 2 by 45, and 3 by 75 is mathematically the same as multiplying by 30 and subtracting 15: this linear change won't affect most interpolation methods, including IDW (and it shouldn't, because it's just a way of re-expressing exactly the same numbers using a different unit of measurement). You would be better off interpolating the original pre-coarsened depth values and then reclassifying the resulting grid if need be.

share|improve this answer
Thank you. Indeed, as you say, the substitution of values ​​does not lead to any improvement. On the other hand I don't have the pre-coarsened values (sorry, obviously they are values of slope) so I have no other option. – Antonio Feb 12 '13 at 10:48

Your Answer


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.