[GRASS-user] DB copy for v.db.connect

Hi,

it is advised to copy DB before running v.db.connect to a second map, as
if you delete the second map the DB will be removed for the parent map
too. db.copy seems the obvious way to do that, but db.* only work if the
source map (ie table) is in the same mapset as the new map. How to copy
a DB from another mapset to the current one cleanly? Like 'g.copy vect='
does, but only the DB table.

e.g. attach table from roads@PERMANENT to new map in current mapset.

??

thanks,
Hamish

On 03/11/08 12:37, Hamish wrote:

Hi,

it is advised to copy DB before running v.db.connect to a second map, as
if you delete the second map the DB will be removed for the parent map
too. db.copy seems the obvious way to do that, but db.* only work if the
source map (ie table) is in the same mapset as the new map.

???

db.copy doesn't care about maps (only v.db.* modules care about maps),
it only cares about tables, databases and drivers and AFAIK you can copy
any table from any supported database to any other supported database...

Moritz

On Mon, Nov 3, 2008 at 12:37 PM, Hamish <hamish_b@yahoo.com> wrote:

Hi,

it is advised to copy DB before running v.db.connect to a second map, as
if you delete the second map the DB will be removed for the parent map
too. db.copy seems the obvious way to do that, but db.* only work if the
source map (ie table) is in the same mapset as the new map. How to copy
a DB from another mapset to the current one cleanly? Like 'g.copy vect='
does, but only the DB table.

e.g. attach table from roads@PERMANENT to new map in current mapset.

Could you trick it with
g.mapset
and generate a tmp sqlite file?

Markus

Moritz Lennert wrote:

> it is advised to copy DB before running v.db.connect to a second map, as
> if you delete the second map the DB will be removed for the parent map
> too. db.copy seems the obvious way to do that, but db.* only work if the
> source map (ie table) is in the same mapset as the new map.

???

db.copy doesn't care about maps (only v.db.* modules care about maps),
it only cares about tables, databases and drivers and AFAIK you can copy
any table from any supported database to any other supported database...

Right. Although with DBF, the default database is the current mapset's
"dbf" directory. This just means that you have to explicitly specify
the database rather than using the default.

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