[GRASS-user] Re: two questions on setting a new layer for for a vector

G. Allegri giohappy at gmail.com
Tue Nov 22 02:44:36 EST 2011


I've solved my needs about the creation of a new layer, but I feel that the
mechanism a bit counter-intuitive.
A new layer can be created *only* through an intemediary vector

>> v.category input=rivers output=rivers_tmp layer=2
>> g.remove vect=rivers
>> g.rename vect=rivers_tmp,rivers

Directly creating a new connection on a new layer produces the new layer,
but the categories are not attached:

>> v.db.connect map=rivers table=rivers_clone layer=2

and the vector *seems* to have a new layer, but it cannot be used.
I see the same results if I create a new layer through the wxGUI (vector
attributes window -> new layer). A new layer is shown, but it cannot be
used (eg cannot be displayed). I will open a ticket on this.

giovanni


2011/11/20 G. Allegri <giohappy at gmail.com>

> I'm having some doubts on the layer mechanism.
> Two questions in this point.
>
> 1) Creating a new layer (ie a new connection between a vector and a DB
> table)
> I've imported a vector (rivers) through v.in.ogr, then I've cloned the
> original table:
> >> db.copy from_table=rivers to_table=rivers_clone
> I've created a new connection:
> >> v.db.connect map=rivers table=rivers_clone layer=2
>
> At this point I supposed that the last command had created all the needed
> structures and fields for the new layer (2), but if I print the categories:
> >> v.category input=rivers layer=2 option=print
> no categories are displyed (while they are listed if I choose layer 1)
>
> Question: I thought that a new connection used the same vector categories,
> but it seems I was wrong. How to make the layer 2 use the same vactor
> categories from layer 1?
>
> 2) I haven't understood the purpose of v.category chlayer option.
> The manual says that the commands change layer numbers. If I understand it
> correctly, it changes the numbering of the vector-db connections, right?
> Whatever it means I wonder why a new vector is created. If I have a vector
> with layers 1,2 I thought that chlayer let me swap the numbers, but if it
> creates a new vector it doesn't change the layer numbers, it creates a new
> layer with the new layer number... I'm confused
>
> Help :)
> thx,
> giovanni
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20111122/f998c848/attachment.html


More information about the grass-user mailing list