[GRASS-dev] Some v.db.addtable and [v.]category confusion
Markus Neteler
neteler at itc.it
Fri May 18 15:00:08 EDT 2007
Hi,
I got a second time trapped by the problem that v.db.addtable
(no longer?) adds rows into the new attribute table. I suspect
that a v.category call is needed before v.to.db (at the end
of the script). But v.category would write into a new map
and then handling gets messy.
Example:
# Spearfish
g.copy vect=fields,myfields
v.db.addtable myfields layer=2 col="polynum integer"
v.category myfields op=report layer=2
LAYER/TABLE 1/myfields:
type count min max
point 0 0 0
line 0 0 0
boundary 0 0 0
centroid 63 1 63
area 0 0 0
all 63 1 63
-> it's not clear from this output that it is only layer 1!!
(try: v.category myfields op=report layer=33
which gives the same result)
So: in reality there aren't any categories yet on layer 2.
v.category myfields out=myfields_new op=add layer=2
v.db.select myfields_new layer=2
cat|polynum
Nothing again. I think that there should be a row for each
vector now but it isn't. Due to that I cannot use v.db.update
on it to insert new polynum values.
?
Markus
More information about the grass-dev
mailing list