[GRASS-user] fast updating of a large map from several small ones.

Glynn Clements glynn at gclements.plus.com
Sat Dec 26 06:48:07 EST 2009


Milton Cezar Ribeiro wrote:

> I have a large raster project (~60,000 x 48,000 pixels)
> and I extracted the drainage from DEM for ~1,000 subbasin.
> Now I would like to join all the pieces of drainage, but
> whem I tryed :
>  g.region  rast=`g.mlist pat=ANA_COD5_drenbin_* sep=,`
>  r.series input=`g.mlist pat=ANA_COD5_drenbin_* sep=,`
> output=ANA_COD5_drenbin_join method=maximum --o
> 
> I get error because the (I suppose) the shell not support
> my large number of raster names on rast= and input=
> at g.region and r.series, respectivelly.

What error, exactly?

> As my base map is very large, if I try something like
> 
> r.mapcalc "ANA_COD5_drenbin_joinAUX=if(AnyMAP>0, AnyMAP,
> ANA_COD5_drenbin_join)"
> g.rename rast=ANA_COD5_drenbin_joinAUX,ANA_COD5_drenbin_join
> 
> it is very time expensive, because of the size of my base/large
> map. Is there a way of I update only part of a map, using
> g.region or r.region for each subbasing, update my
> base map without loss other information already stored
> on base map?

You cannot modify a raster map in-place.

With very large numbers of maps, you may run into OS limits on the
maximum number of open files (see "ulimit -n"), or on the length of a
command line.

One option is to see if you can subdivide the task. For an associative
operation (e.g. maximum), this is usually straightforward; i.e. rather
than running r.series on 1000 maps at once, you could run it on 10
batches of 100 followed by a final pass on the 10 intermediate
results.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list