[GRASS-user] Copying a location subset to a new location

Hello list.

I have been making subset copies of GRASS locations using (the very useful) g.laptop.sh add-on
http://grass.osgeo.org/wiki/GRASS_AddOns#g.laptop.sh

It can only be run interactively, and that becomes a bit tedious with more than a few maps. Hence I wonder if g.laptop.sh is the only approach to sub-setting GRASS locations (i.e., copying a location subset to a new location). Currently it is the only approach I could find.

Kind regards and thank you in advance for any hints,

Luigi

On Mon, Jul 30, 2012 at 7:31 PM, Luigi Ponti <lponti@inbox.com> wrote:

Hello list.

I have been making subset copies of GRASS locations using (the very useful)
g.laptop.sh add-on

...

Currently it is the only approach I could find.

I used r.pack/r.unpack and v.pack/v.unpack in the past which
packages maps individually. Using g.mlist or likewise you could
write a "for" loop to package a set of maps.

Best,
Markus

On 02/08/2012 01:26, Markus Neteler wrote:

On Mon, Jul 30, 2012 at 7:31 PM, Luigi Ponti <lponti@inbox.com> wrote:

Hello list.

I have been making subset copies of GRASS locations using (the very useful)
g.laptop.sh add-on

...

Currently it is the only approach I could find.

I used r.pack/r.unpack and v.pack/v.unpack in the past which
packages maps individually. Using g.mlist or likewise you could
write a "for" loop to package a set of maps.

Thanks Markus:

I did not know about those grass7 addons. The vector versions are there in the trac svn browser. However, I don't see the raster ones (r.pack/r.unpack).

At any rate, I have modified g.laptop.sh to run using the g.parser interface. Cleaned up indentation and comments a bit. I am not sure it can be useful. Maybe it could function as a g.copy.location kind-of-thing. It still has a problem with deleting tmp raster folder at the end of the script. Other than that, it seems to work fine on my Win7 32-bit box under winGRASS 64svn. It is attached for review just in case.

Kind regards,

Luigi

(attachments)

g.laptop_non_interactive.sh (14.2 KB)

On Thu, Aug 2, 2012 at 10:54 PM, Luigi Ponti <lponti@inbox.com> wrote:

On 02/08/2012 01:26, Markus Neteler wrote:

On Mon, Jul 30, 2012 at 7:31 PM, Luigi Ponti <lponti@inbox.com> wrote:

Hello list.

I have been making subset copies of GRASS locations using (the very
useful)
g.laptop.sh add-on

...

Currently it is the only approach I could find.

I used r.pack/r.unpack and v.pack/v.unpack in the past which
packages maps individually. Using g.mlist or likewise you could
write a "for" loop to package a set of maps.

Thanks Markus:

I did not know about those grass7 addons. The vector versions are there in
the trac svn browser. However, I don't see the raster ones
(r.pack/r.unpack).

I checked: They are already part of GRASS 7.

At any rate, I have modified g.laptop.sh to run using the g.parser
interface. Cleaned up indentation and comments a bit. I am not sure it can
be useful. Maybe it could function as a g.copy.location kind-of-thing. It
still has a problem with deleting tmp raster folder at the end of the
script. Other than that, it seems to work fine on my Win7 32-bit box under
winGRASS 64svn. It is attached for review just in case.

Great, Luigi! While I don't manage to check, some other user will perhaps
do it. Then it could be maintained in the Addons repo.

Best
Markus