Hi,
I performed an analysis to get the distances between single points
within a network using v.net.allpairs. As a result a point vector is
created containing following information in the attribute table:
for example
cat,to_cat,cost
1,1,0
1,2,12
1,3,10
2,1,12
2,2,0
2,3,17....
.... so there are actually several lines associated with the same cat
value (of course as
the tool gives all pairwise distances). However, when I try to export the table
into a text file using v.out.ascii only one line per cat is
exported... How can I export
the whole table as shown in attribute table of the vector?
thank you and best regards,
Johannes
On Wed, Jan 30, 2013 at 3:28 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:
Hi,
I performed an analysis to get the distances between single points
within a network using v.net.allpairs. As a result a point vector is
created containing following information in the attribute table:
for example
cat,to_cat,cost
1,1,0
1,2,12
1,3,10
2,1,12
2,2,0
2,3,17....
.... so there are actually several lines associated with the same cat
value
This has been changed in GRASS 7. Here, the attribute table has the
entries cat, from_cat, to_cat, cost, cat is unique and the category of
a shortest path.
However, when I try to export the table
into a text file using v.out.ascii only one line per cat is
exported... How can I export
the whole table as shown in attribute table of the vector?
You could try db.select and feed the output to another datatbase.
Markus M
On Wed, Jan 30, 2013 at 4:51 PM, Markus Metz
<markus.metz.giswork@gmail.com> wrote:
On Wed, Jan 30, 2013 at 3:28 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:
Hi,
I performed an analysis to get the distances between single points
within a network using v.net.allpairs. As a result a point vector is
created containing following information in the attribute table:
for example
cat,to_cat,cost
1,1,0
1,2,12
1,3,10
2,1,12
2,2,0
2,3,17....
.... so there are actually several lines associated with the same cat
value
This has been changed in GRASS 7. Here, the attribute table has the
entries cat, from_cat, to_cat, cost, cat is unique and the category of
a shortest path.
However, when I try to export the table
into a text file using v.out.ascii only one line per cat is
exported... How can I export
the whole table as shown in attribute table of the vector?
You could try db.select and feed the output to another datatbase.
I though about creating manually a new from_cat column using
v.db.update to get the values from cat to from_cat and then assigning
new unique cat values to the cat column (with v.db.*??)
Johannes
Markus M
On Wed, Jan 30, 2013 at 5:16 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:
On Wed, Jan 30, 2013 at 4:51 PM, Markus Metz
<markus.metz.giswork@gmail.com> wrote:
On Wed, Jan 30, 2013 at 3:28 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:
Hi,
I performed an analysis to get the distances between single points
within a network using v.net.allpairs. As a result a point vector is
created containing following information in the attribute table:
for example
cat,to_cat,cost
1,1,0
1,2,12
1,3,10
2,1,12
2,2,0
2,3,17....
.... so there are actually several lines associated with the same cat
value
This has been changed in GRASS 7. Here, the attribute table has the
entries cat, from_cat, to_cat, cost, cat is unique and the category of
a shortest path.
However, when I try to export the table
into a text file using v.out.ascii only one line per cat is
exported... How can I export
the whole table as shown in attribute table of the vector?
You could try db.select and feed the output to another datatbase.
I though about creating manually a new from_cat column using
v.db.update to get the values from cat to from_cat and then assigning
new unique cat values to the cat column (with v.db.*??)
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)
Markus M
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>
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...
Anyway it seems the easiest way is to just fetch the entries with
db.select as Markus said before.
...or to use GRASS7 
/johannes
On Thu, Jan 31, 2013 at 11:00 AM, Johannes Radinger
<johannesradinger@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.
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
On Thu, Jan 31, 2013 at 11:38 AM, Markus Metz
<markus.metz.giswork@gmail.com> wrote:
On Thu, Jan 31, 2013 at 11:00 AM, Johannes Radinger
<johannesradinger@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
On Thu, Jan 31, 2013 at 11:41 PM, Markus Metz
<markus.metz.giswork@gmail.com> wrote:
On Thu, Jan 31, 2013 at 11:38 AM, Markus Metz
<markus.metz.giswork@gmail.com> wrote:
On Thu, Jan 31, 2013 at 11:00 AM, Johannes Radinger
<johannesradinger@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