How can I set the Grass Region in Python without already having a map in the Mapset? Basically I am looking for the equivalent to this window
enter image description here
Currently I am only able to extent an existing region, which leads in my case to very big regions.
asked Nov 14, 2013 at 0:43
1 Answer 1
How about this:
import grass.script as grass
grass.run_command('g.region', n=10, s=9, e=35, w=33, ewres=0.1, nsres=0.2, verbose=True, flags='p')
projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 10N
south: 9N
west: 33E
east: 35E
nsres: 0:12
ewres: 0:06
rows: 5
cols: 20
cells: 100
answered Nov 14, 2013 at 12:08
-
g.region
requires in my Grass (6.4.3) a parameter <map> (Raster map to change). What version are you on? What am I doing wrong? In the documentation I don't see this parameter either.ustroetz– ustroetz2013年11月14日 18:13:44 +00:00Commented Nov 14, 2013 at 18:13 -
No, g.region works on the overall "computational region", and is not specific to one map. That's the same for all version. THere is a different command, r.region which changes the extent and resolution of a single raster. Is that what you meant?Micha– Micha2013年11月16日 11:43:57 +00:00Commented Nov 16, 2013 at 11:43
Explore related questions
See similar questions with these tags.
lang-py