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

Johannes Radinger johannesradinger at gmail.com
Fri Feb 1 02:51:33 PST 2013


On Thu, Jan 31, 2013 at 11:41 PM, Markus Metz
<markus.metz.giswork at gmail.com> wrote:
> 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.
>

Thank you Markus,

I just grabbed the chance and switched over to GRASS7... I already wanted
to migrate to GRASS7 in the near future anyway....

And I tried the v.net.allpairs tool and that works great in the new GRASS...it
is always good to have some successful experiences when starting with
a new software :)

So problem with the unique category values is solved!...But what I just realized
in comparison to the old version: There is no distance from-to the
same node calculated, so
all the 0-distances (e.g. from 1 to 1) are missing in the new version,
what is not a problem
to me just a difference that I noted.

Johannes

> 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