I'm currently attempting to use r.region to preform analysis on a specific area of a raster image. I'm receiving Lat/Long data from the step before me, but I'm having issues using that data in r.region.

The command I'm currently running is:

r.region map=dem n=32:13:51N s=32:13:34N e=110:56:46W w=110:57:13W

Which returns the error:

`ERROR: <n=32:13:51N> ** illegal value **`

What I'm confused about is that according to the specification, this input should be legal for r.region on GRASS 6.4. According to the documentation (https://grass.osgeo.org/grass64/manuals/r.region.html) the boundaries can be specified as:

      Value for the northern edge (format dd:mm:ss{N|S})
      Value for the southern edge (format dd:mm:ss{N|S})
      Value for the eastern edge (format ddd:mm:ss{E|W})
      Value for the western edge (format ddd:mm:ss{E|W})

Why does my input fail when as far as I can tell it is in the correct format?

All the examples I've seen of r.region don't do it this way and instead do something like r.region map=mymap n=220750 s=220000 w=638300 e=639000. I would have no problem running like this except I don't understand what those values are and how to convert from lat/long (I have both DD and DMS) to this integer value.

2 Answers 2


The issue is that you are using:

r.region map=dem n=32:13:51N s=32:13:34N e=110:56:46W w=110:57:13W

and the correct format is:

r.region map=dem n=32:13:51N s=32:13:34S e=110:56:46E w=110:57:13W

In my particular case, I tried out with:

r.region map=palma.blue n=09:30:00N s=09:27:00S w=84:07:30W e=84:07:01E

and it works perfectly; as it can be observed at the next image:

enter image description here

  • Of course its was some stupid autogenerated typo. Thanks! Apr 17, 2016 at 19:24

Most likely your location has a projected coordinate system (meaning coordinates in the format X-Y not Lat/Long). What does g.region -p give you? If that is the case, you can use an online converter such as this one to find the Lat/Long values for the region you want to set.

I would have written this as a comment but unfortunately reputation is too low...

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.