[GRASS-dev] [GRASS-user] Problems in adding tables to a map

Hi,

2012/11/17 Aldo Clerici <aldo.clerici@unipr.it>:

v.db.connect map=roads1 table=roads2 layer=2

it's not enough. You need to defined also categories for layer '2',
see `v.category` for details. This module allows to change layer
number, but unfortunately not to copy categories from one layer to
another.

Motion:

v.category input=roads1 output=roads2 option=cpylayer layer=1,2

to copy categories from layer 1 to layer 2 would make sense? It would
require to add new option `cpylayer` similarly to `chlayer`.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

On 21/11/12 13:02, Martin Landa wrote:

Hi,

2012/11/17 Aldo Clerici<aldo.clerici@unipr.it>:

v.db.connect map=roads1 table=roads2 layer=2

it's not enough. You need to defined also categories for layer '2',
see `v.category` for details. This module allows to change layer
number, but unfortunately not to copy categories from one layer to
another.

Motion:

v.category input=roads1 output=roads2 option=cpylayer layer=1,2

to copy categories from layer 1 to layer 2 would make sense? It would
require to add new option `cpylayer` similarly to `chlayer`.

Already exists in grass7: option=transfer

Moritz

Hi,

2012/11/21 Moritz Lennert <mlennert@club.worldonline.be>:
Already exists in grass7: option=transfer

ops, I was accidentally checking 6.5. Too many versions installed :wink:
Thanks for the correction.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

On 22/11/12 16:59, Aldo Clerici wrote:

So, if I need to assign different attributes to the objects in the vector
file I need to assign new categories to the objects and store them in a new
layer to be connected to a different table.
But how can I add a new layer to a vector?
v.category seems to produce a new vector map with new category values but
doesn't add a new layer in the input map.

Sure it does. v.category op=add layer=2 ... will create a new map with the old category values preserved in layer 1 and with new category values in layer 2. And as mentioned in a previous mail, in GRASS7 you can simply copy the category values of layer 1 to layer 2 with op=transfer.

But I suppose there is another simpler way to add and fill a new layer as,
for example, to reclass the category numbers of a map and put the reclassed
categories in a new layer to be connected to a new table with new
attributes. Or not?

AFAIK, v.reclass does not allow you to chose the layer of categories in the new map, only which layer to use in the old map.

Moritz

On Sat, Nov 24, 2012 at 11:31 AM, Moritz Lennert
<mlennert@club.worldonline.be> wrote:

Sure it does. v.category op=add layer=2 ... will create a new map with the
old category values preserved in layer 1 and with new category values in
layer 2. And as mentioned in a previous mail, in GRASS7 you can simply copy
the category values of layer 1 to layer 2 with op=transfer.

I start to like this function (hint hint :slight_smile:
I quickly compared the two main files and it doesn't look like
complicated to backport.
However, I cannot judge if it would have any background complications.

Markus