[GRASS-user] Parallel GRASS jobs .....

Michael Barton Michael.Barton at asu.edu
Wed Nov 28 07:25:25 PST 2012


The computational region (i.e., not the display region in the GUI) is the rectangular section of the world where GIS operations take place. With a few exceptions, all reads/writes to maps take place only within the region. You can set the region extents and resolution in many ways using g.region. You can also save region definitions to disk and call them as needed. For example, you could have a "north" and a "south" saved region and set map operations to alternately work in each of these using g.region region=north or g.region region=south.

Please look over the g.region manual and the general GRASS help for more information on regions. The docs are pretty good.
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice:  480-965-6262 (SHESC), 480-727-9746 (CSDC)
fax:          480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu











On Nov 28, 2012, at 5:37 AM, <grass-user-request at lists.osgeo.org<mailto:grass-user-request at lists.osgeo.org>>
 wrote:

From: Andranik Hayrapetyan <andranik.h89 at gmail.com<mailto:andranik.h89 at gmail.com>>
Subject: Re: [GRASS-user] Parallel GRASS jobs .....
Date: November 28, 2012 4:41:47 AM MST
To: Sylvain Maillard <sylvain.maillard at gmail.com<mailto:sylvain.maillard at gmail.com>>
Cc: grass mailing list <grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>>


I think I don't understand the concept of region itself. Here is the output of my g.region -p
projection: 0 (x,y)
zone:       0
north:      4569989.25
south:      4357350.75
west:       436605.75
east:       670334.25
nsres:      28.5
ewres:      28.5
rows:       7461
cols:       8201
cells:      61187661

Please, can you tell me how to reduce this region into 2 chunks.

Thanks in advance



On Wed, Nov 28, 2012 at 2:43 PM, Sylvain Maillard <sylvain.maillard at gmail.com<mailto:sylvain.maillard at gmail.com>> wrote:
> I was trying to do that with g.region, but it only resized my map and didn't "cut" it.
In fact it didn't modify your map, but resize the area where the calculation is done byt hte other modules : with a small region defined in a mapset, your code will work only on that part of the map in the PERMANENT mapset.

as an example with a region of n=100 s=0 e=100 w=0, you can pass the region limits to your script (eg: my_script.sh 50 0 50 0;  my_script.sh 100 50 50 0; ...) so the calculation are made only of a quarter of the whole region.
if your script can handle arguments, it will the first define its own sub-region from what you passed to it: "g.region n=$1 s=$2 e=$3 w=$4"

Sylvain


2012/11/28 Daniel Lee <lee at isi-solutions.org<mailto:lee at isi-solutions.org>>
Hi there,

I do this too and the standard methodology for me is to leave the resolution the same and change the region's borders. Take a look at the manual of g.region for guides on this, but let's say I've got the following:

GRASS 6.4.3svn (EPSG4326_WGS84_ll):~ > g.region -g
n=63
s=-63
w=95
e=180
nsres=1.10020395685734e-05
ewres=1.10020399076346e-05
rows=11452422
cols=7725840
cells=88479579984480

Then to reduce the region's size I'd do e.g.:
g.region n=50 s=-50 w=100 e=110

That would "shrink" my region down to the area that I'm interested in.

HTH!
Daniel



2012/11/28 Andranik Hayrapetyan <andranik.h89 at gmail.com<mailto:andranik.h89 at gmail.com>>
I have been trying something like this some time ago, but I could not define region of a mapset as chunk of the whole region.
Is g.region the right tool for this task?
If it is not difficult for you, can you, please, explain the process of  doing  " define the region of each mapset as a chunk of the whole region " a bit more detailed.


On Wed, Nov 28, 2012 at 1:56 PM, Sylvain Maillard <sylvain.maillard at gmail.com<mailto:sylvain.maillard at gmail.com>> wrote:
Hi,

for this approach, the best would be to
(before the multi-process job)
- put your map into the PERMANENT mapset

(for each process in parallel)
- make a new mapset for each process
- define the region of each mapset as a chunk of the whole region
- make your calculation

(once the process competed)
- put together all the results (eg, with r.patch)


Sylvain



_______________________________________________
grass-user mailing list
grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/grass-user



_______________________________________________
grass-user mailing list
grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/grass-user






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20121128/211427ce/attachment-0001.html>


More information about the grass-user mailing list