[GRASS-dev] v.to.db problems if layer > 1
Moritz Lennert
mlennert at club.worldonline.be
Wed Nov 26 18:10:54 EST 2008
On 26/11/08 11:34, Markus Neteler wrote:
> I try to use v.db.addtable with a second layer but v.to.db apparently fails
> (called by v.db.addtable):
>
> # Spearfish
> g.copy vect=roads,myroads --o
> v.info -c myroads
> v.db.addtable myroads table=extratab layer=2 columns="cat
> integer,label varchar(100)"
> ...
> Updating database...
> 100%
> 1 categories read from map <- BAD should be 6
Why, roads has no features in layer two, so just by copying it and
adding a new table to another layer, you do not add new categories in
that layer. You would need 'v.category option=add layer=2' for that.
> ...
>
> v.db.select myroads layer=2
> cat|label
> <- empty, should have 6 cats
>
> # compare layer1:
> v.db.select myroads layer=1
> cat|label
> 0|no data
> 1|interstate
> 2|primary highway, hard surface
> 3|secondary highway, hard surface
> 4|light-duty road, improved surface
> 5|unimproved road
>
> -----------
> # calling directly v.to.db
> v.to.db myroads layer=2 option=cat col=cat qlayer=1
Shouldn't this be:
v.to.db myroads layer=2 option=query col=cat qlayer=1 qcolumn=cat
?
Moritz
More information about the grass-dev
mailing list