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

Markus Metz markus.metz.giswork at gmail.com
Wed Jan 30 08:49:29 PST 2013


On Wed, Jan 30, 2013 at 5:16 PM, Johannes Radinger
<johannesradinger at gmail.com> wrote:
> On Wed, Jan 30, 2013 at 4:51 PM, Markus Metz
> <markus.metz.giswork at gmail.com> wrote:
>> On Wed, Jan 30, 2013 at 3:28 PM, Johannes Radinger
>> <johannesradinger at 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


More information about the grass-user mailing list