[GRASS-dev] Struggling using two layered vector maps with v.what.rast

Markus Metz markus.metz.giswork at googlemail.com
Wed Jan 25 06:10:51 EST 2012


2012/1/25 Sören Gebbert <soerengebbert at googlemail.com>:
> Hi Martin,
> many thanks for your example. It works fine with two layer.
>
> But is there a way to add categories to a number of layers larger than
> two using the same vector map?

This will add new categories to a new layer, irrespective of how many
layers are already defined:
v.category option=add

Note that a GRASS layer is defined by the existence of at least one
vector feature with at least one category value in that layer. That
layer may or may not be attached to an attribute table. For examples,
see v.in.ogr when importing several layers at once, the LiDAR
filtering tools, or the vector output of r.stream.extract.

> Why is a full vector copy needed in case of category transfer from one
> to another layer?

Because category transfer takes place in the vector feature, i.e.
modifies the coor file of the vector. v.category option=transfer does
not add an attribute table (AFAIK).

>
>  i just started to investigate the
> new shiny world of multiple layer usage.

I hope you enjoy it!

Markus M

>
> Best regards
> Soeren
>
> 2012/1/25 Martin Landa <landa.martin at gmail.com>:
>> Hi,
>>
>> db.copy from_table=soil to_table=soil_2
>>
>> -> makes copy of `soil` table
>>
>> v.db.addtable map=soil table=soil_2 layer=2
>>
>> -> it would overwrite `soil_2` table, but do nothing in this case, no
>> feature have category defined in layer 2.
>>
>> Proposal:
>>
>> v.random --o -z seed=1 output=soil n=20 zmin=0 zmax=100 column=clay
>> v.category input=soil out=soil2 option=transfer layer=1,2 --o
>> db.copy from_table=soil to_table=soil_2
>> v.db.connect map=soil2 table=soil_2 layer=2
>>
>> v.db.addcolumn map=soil2 layer=1 columns='sand_frac DOUBLE PRECISION'
>> v.db.addcolumn map=soil2 layer=2 columns='sand_frac DOUBLE PRECISION'
>> ...
>>
>> Martin
>>
>> --
>> Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev


More information about the grass-dev mailing list