[GRASS5] attributes using v.overlay

Radim Blazek blazek at itc.it
Mon Sep 6 12:13:24 EDT 2004

On Monday 06 September 2004 17:13, Otto Dassau wrote:
> Dear list,
> I used the module v.overlay with operator "or" -> union, but I guess it`s
> the same for all operators. I have following problems with the attributes.
> ### Example:
> v.overlay ainput=area1 binput=area2 output=area3 operator=or
> the attribute table for area3 looks like this:
> cat | cata | catb
> 1   |   2  |  4
> 2   |   4  |  7
> ...
> AFAICS these columns can be connected to the attribute tables from ainput
> and binput using different fields.
> It seems that this is not done automatically, because in file
> vectors/area3/dbln only one link to column "cat" is set
> -> 1 area3 cat $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
> anyway now I can add further links to the other attribute tables via fields
> manually or by using v.db.connect
> -> 2 area1 cat $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
> -> 3 area2 cat $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
> When I now query the map I get all attributes from the two maps I overlayed
> (unioned) before - this is nice and the result I was expecting. #######
> Now my questions:
> a) Why are the two attribute tables of the input maps area1 and area2 not
> automatically linked in vectors/area3/dbln?

The tables area1 and area2 are parts of of other vectors. It would be necessary
to make a copy of those tables. My intention however is to create a new table
linked to the field 1 which will contain attributes from both tables.

> b) How is it possible to query two attributes represented by different
> fields? E.g. show all areas where area1 connected through field 2 has value
> 1 and area2 connected through field 3 has value 2.

You have to join the tables somehow (area1,area2,area3) or to use v.extract 

> c) When I remove the overlayed map area3, also the basemaps area1 and area2
> are deleted, which is really bad :-(. How can I prevent this without
> removing the "dbln" entries?

The input maps?! No, just the tables. v.db.connect prints a warning.
The table linked to a vector is part of the vector. The only thing
we can do to prevent this, is to remove v.db.connect, I think.


More information about the grass-dev mailing list