[GRASS-user] v.out.ascii with vector created by v.net.allpairs

Markus Metz markus.metz.giswork at gmail.com
Thu Jan 31 14:41:49 PST 2013


On Thu, Jan 31, 2013 at 11:38 AM, Markus Metz
<markus.metz.giswork at gmail.com> wrote:
> On Thu, Jan 31, 2013 at 11:00 AM, Johannes Radinger
> <johannesradinger at gmail.com> wrote:
>>>
>>> You could
>>> 1) create new categories in a new layer with v.category
>>> 2) add columns from_cat, to_cat to the new layer
>>> 3) upload values by assigning from_cat (new layer) = cat (old layer)
>>> and to_cat (new layer) = to_cat (old layer)
>>>
>>
>> That sounds like a good idea, but somehow I fail. What I did was:
>> 1) create a new attribute table/layer for the vector point map with
>> v.db.addtable map="orig" table="new_table" layer=2
>>
>> 2) The second layer does have a cat column but without any entries
>> yet. So far so good
>> So I tried as you said to create new unique categories in this new layer with
>> v.category input=orig output=new layer=2
>>
>> But here I get following error:
>> Copying attribute table(s)...
>> DBMI-SQLite driver error:
>> Error in sqlite3_step():
>> indexed columns are not unique
>> WARNING: Unable to create index for table <new_1>, key <cat>
>>
> Try to start everything again anew with dbf as default database
> connection. This should avoid the index problem because dbf does not
> support indexing.

This advice was nonsense, sorry! The attribute table created by
v.net.allpairs in GRASS 6 can not be used as an attribute table. The
only two things you can do is dump the table with db.select and
v.db.connect -d in order to disconnect the table from the vector.

Markus M

>> v.category copies the map to a new one and tries to connect both
>> attribute tables....but there are no unique cat values in table/layer 1
>>
>> Is it possible to update layer to without copying the whole map with
>> both layers (v.category)
>> to get new cats in layer 2...
>
> But you need the attribute table for layer 1 in order to create the
> desired attribute table for layer 2?
>
> HTH
>
> Markus M
>
>>
>> Anyway it seems the easiest way is to just fetch the entries with
>> db.select as Markus said before.
>> ...or to use GRASS7 :)
>>
>> /johannes


More information about the grass-user mailing list