I'm not sure I understand how to use r.reclass in GRASS.

Can somebody go through what the inputs should be or direct me to a tutorial (I've looked...) for the current version? I get an error when I try to use it, and I think it's just because my text inputs are wrong or something like that

EDIT: My inputs were:

Name of raster to be reclassified

grdn36w104_13 [a DEM from the USGS]

File containing reclass rules

(a .txt file with the text)

 1525 thru 3110 = 1
    0 thru 1524 = NULL
    3111 thru 5000  = NULL

Name for raster output map


The error message was:

enter image description here

Followed by "Cannot get region map of grdn36w104_13@Elevation_Data", then "Cannot get input region"

  • Did you set the computational region? Please see grasswiki.osgeo.org/wiki/Computational_region Commented Apr 3, 2018 at 14:52
  • In my limited knowledge, I'm having a hard time understanding how this is relevant to what I'm doing, i.e. the wiki page has information but nothing actionable that I can find for my situation
    – Shane
    Commented Apr 3, 2018 at 20:33
  • "Absolute data is different. Here the challenge is to redistribute a finite amount of something into the new cells. It is not an issue of interpolation, but an issue of reassigning data from one partition into another." This seems like the most relevant section, but from what I've read about r.reclass it is just reassigning raster values (actually mapping groups of values to other values, not even creating a new raster to save disk space), not changing the resolution
    – Shane
    Commented Apr 3, 2018 at 20:36
  • 1
    I feel ok about 3, 4 and 5, and I think I did 1 when I started GRASS for the first time (I chose N. America, unless this was for something else). I never imported my data, I'll look into that
    – Shane
    Commented Apr 6, 2018 at 3:09
  • 1
    Indeed, that was the issue. Worked great once I imported the raster. Thanks for walking me through that!
    – Shane
    Commented Apr 6, 2018 at 4:24

1 Answer 1


One approach to work with GRASS GIS' r.reclass module is:

  1. create a Location based on the spatial reference system of the data in question
  2. import the data in question in the PERMANENT or another custom Mapset
  3. set the computational region to match the extent of the data in question
  4. create the reclassification rules file--the rules posted in the question appear to be correct
  5. run r.reclass

Related Q&As

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.