[GRASS5] Layers Clarification

Michael Barton michael.barton at asu.edu
Mon Mar 6 16:25:54 EST 2006


Moritz,

I want to embellish on Radim's response a bit.

ONE vector object can join with can be joined with ONE attribute table for
EACH "layer" it has. If it has ONE layer, it can join with ONE table, if it
has TWO layers, it can join with TWO tables.

Each "layer" is a data field or column (integer format) named "cat". Each
vector object has at least 1 cat column ("layer 1") defined by default. You
can optionally add more cat columns ("layer 2", "layer 3", ...). Each cat
column serves as a key field to make a join with an attribute table.

The cat values in different layers can be completely different. For example,
a particular vector point can have cat=1 for layer 1, cat=5 for layer 2, and
cat=38 for layer 3.

The "cat" integers in a "layer" key field must match with a corresponding
key field (integer format) in the attribute table you want to join. To
continue with the above example, the vector point would join with a
line/record in an attribute table whose key field has a value of 1 for layer
1, with a line/record in a DIFFERENT table with whose key field=5 for layer
2, and a line/record in a THIRD table whose key field=38 for layer 3.

In this way,  a single vector can be linked with (i.e., one-to-one or
many-to-one) multiple attribute tables, *IF* you have defined multiple
layers. But ONE layer, can only be joined with ONE attribute table.

I find this a very useful feature, but agree with Trevor that it needs to be
documented better. I wrote up something on the GRASS WIKI that could be
added to the docs but I haven't had time to do it yet.

I hope this helps.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ  85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


> From: Moritz Lennert <mlennert at club.worldonline.be>
> Date: Mon, 06 Mar 2006 11:17:14 +0100
> To: Trevor Wiens <twiens at interbaun.com>
> Cc: GRASS5 <grass5 at grass.itc.it>, Radim Blazek <radim.blazek at gmail.com>,
> Helena Mitasova <hmitaso at unity.ncsu.edu>, Martin Landa
> <landa.martin at gmail.com>, Michael Barton <michael.barton at asu.edu>
> Subject: Re: [GRASS5] Layers Clarification
> 
> Trevor Wiens wrote:
>> Thanks you all for your comments.
>> 
>> I want to make sure I understand so I will reiterate what I
>> understand you to have said.
>> 
>> 1. What is a vector file "layer".
>> 
>> In a GRASS vector file there is a single collection of spatial objects.
>> Those spatial objects can be associated with one or more keys (called
>> layers in current terminology). The use of these multiple keys allow
>> for grouping of topologically related objects in a single layer that
>> are thematically different (forests and lakes or lines and nodes). This
>> also allows for linking different series of attribute data to a single
>> object.
> 
> Taking the risk of confusing things a bit more, but I do want to try to
> understand. In an exchange with Radim on layers in September, we came to
> the following conclusion of the discussion:
> 
> ***********
> On 9/16/05, Moritz Lennert <mlennert at club.worldonline.be> wrote:
>> Ok, so it was a problem of me not understanding layers correctly.
>> Sorry...
>> Do I then understand correctly that you cannot link one layer to
>> different tables simultaneously ?
> 
> Yes, you cannot.
> 
> Radim
> **************
> 
> This seems to contradict what Trevor write above, i.e. "This also allows
> for linking different series of attribute data to a single object."
> 
> So if I want to link different data tables simultaneously to the same
> object, I have to duplicate the object in two layers, or ?
> 
> The idea of layers, as I understood it so far, is to be able to have
> different objects linked to separate tables, but all in the same
> topological file.
> 
> Moritz




More information about the grass-dev mailing list