[GRASS-user] problem with v.db.update and categories

tommaso tommasodb at googlemail.com
Mon Dec 8 01:37:02 PST 2014


It seems to work better with the sqlite driver...
Maybe the command v.db.update does not work with DBF driver?

Thanks, Tommaso




On Wed, 03 Dec 2014 12:18:13 +0100, tommaso <tommasodb at googlemail.com>  
wrote:

> Ok, now can I add the missing categories in dbf table with:
> v.to.db map='polygons' type='centroid' option='cat'
> But the update command is still failing:
> v.db.update map=polygons col=building value=3.0
>
> The new categories in dbf table have still empty 'building' attributes...
>
>
>
> On Wed, 03 Dec 2014 09:42:28 +0100, tommaso <tommasodb at googlemail.com>  
> wrote:
>
>> Hello, I'm trying to polygonize a lines layers. I imported the layer in
>> grass with v.in.ogr as boundaries, then I attached the centroids with
>> v.centroid.
>> Probably because of the polygonize, some attribute are lost in in the
>> output map, so I have to update the table to fix the attributes:
>> v.db.update input='polygons' col=building, value='3.0'
>>
>> After the update, the table look fine with v.db.select: all record have
>> the right value. But if I export the layer with ogr, some records do not
>> have attributes at all. My export command looks so.
>> v.out.ogr format='PostgreSQL' input='polygons' type='area'
>> dsn='PG:dbname=test_project host=localhost' olayer='test_table'
>> This warning is raise by v.to.ogr: WARNING: 8 features without  
>> attributes were written
>>
>> I guess, the map categories are not synchronized with the database.
>> v.categories returns 1018 results, while the map contains only 298  
>> records:
>> v.category polygons option=print | wc
>>       1018    1018    5133
>>
>> Where are so many categories coming from? How can I synchronize map and
>> database?
>> Thanks, Tomm


More information about the grass-user mailing list