[GRASS-dev] v.to.db problems if layer > 1

Moritz Lennert mlennert at club.worldonline.be
Thu Nov 27 12:34:04 EST 2008


On 27/11/08 15:41, Patton, Eric wrote:
>>> Well, I though v.db.addtable would take care of doing the v.category job for
>>> me (see script).
> 
>> AFAIKS, it doesn't. I'm not sure I think that this would be a good idea, 
>> either, as it would indiscriminately attribute categories to all 
>> features in the map (e.g. boundaries and centroids, not only centroids), 
>> unless you add a type option.
>>
>> I have the feeling that this would only complicate issues as too much 
>> would happen without the user really knowing, so I have a preference for 
>> leaving it to the responsibility of the user to create category values.
>>
>> Probably the docs could be better about all this, though.
> 
> I've added a note to the v.db.addtable docs about the need to use v.category 
> to manually add cats to a new table in r34532 (trunk) and r34533 (grass6_devel).

It's not about adding cats to the table (v.db.addtable does this using 
v.to.db), but about the fact that if you add a table with v.db.addtable 
to a layer in which no feature has a category value, there won't be 
anything in the table you add. You have to first either run v.category 
option=add to add category values automatically, or use v.digit to add 
them, and then use v.db.addtable to see those cat values show up in the 
table.

Or you can use v.db.addtable first and then populate the table with a 
combination of v.category option=add + v.to.db or via v.digit.

I've attached a patch to description.html reflecting this, but am not 
sure that my formulation is very clear.

Moritz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.db.addtable_desc.diff
Type: text/x-patch
Size: 1112 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20081127/17794c9e/v.db.addtable_desc.bin


More information about the grass-dev mailing list