[GRASS-user] Nothing Inserted into Attribute Table from v.to.db

Moritz Lennert mlennert at club.worldonline.be
Fri Oct 3 15:11:05 EDT 2008


On 03/10/08 19:03, Ryan R. Rosario wrote:

[...]
> 
> Sorry for the vagueness, but I am thoroughly confused on what goes on with
> these attribute tables at times.

See my response below: the lines in connected_lines to not contain ids 
and so you cannot connect them to any database table.

I guess, you are trying to apply solution 2b proposed in [1] ? But you 
are also trying to get the attributes of the incidents points linked to 
the projected points.

As you can read in that mail: "(you might have to use v.db.addtable on 
that to create a table first, can't remember)". As I mention below, you 
have to do that since v.distance does not create a table.

So, here are the steps I propose (untested):

1) v.distance [...] output=connecting_lines

2) v.db.addtable [...] columns="cat int, inc_cat int"

3) v.distance from=connecting_lines to=incidents upload=cat 
column=inc_cat dmax=0 (I suppose that the connecting lines touch the 
incident points. If they don't you might have to slightly increase dist)

4) db.copy from="incidents table"  to="projected_incidents" (optional, 
you can also link directly to the incidents table)

4) v.db.connect -o connecting_lines key=inc_cat [...]

Moritz

[1] http://lists.osgeo.org/pipermail/grass-user/2008-October/046905.html

> 
> 
> Moritz Lennert-2 wrote:
>> On 03/10/08 08:57, Ryan R. Rosario wrote:
>>> I have vector maps called "incidents" (points) and "roads" (lines). For
>>> some
>>> reason, I am getting nothing as output in the final attribute table; 
>> First of all: could you state clearly and precisely what you want to do ?
>>
>>> that
>>> is, the attribute table is not being updated at all. I am sure I am
>>> making
>>> some silly mistake.
>>>
>> [...]
>>> What could I be doing wrong?
>> This:
>>  > v.distance from=incidents to=roads output=connecting_lines upload=cat
>>  > column=nearest
>>  > #I copied table "incidents" to "connecting_lines" and called it
>>  > "connecting_lines". I used the option
>>  > #key=nearest.
>>
>> (Second: please be more explicit in the description of your actions. In 
>> this case, for example, please tell us which command you used. I assume 
>> v.db.connect...)
>>
>> The output map of the v.distance command contains only lines for 
>> visualisation which do not even contain a category value allowing to 
>> identify each line. You cannot, therefore, link the map to a table. 
>> Well, you can, but no records in the table will correspond to a line as 
>> the latter do not have a ids.
>>
>> Debatedly, v.distance could be enhanced to include some information in 
>> an attribute table accompanying the map, such as from_cat and to_cat, 
>> but someone would have to implement that.
>>
>> Moritz
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>>
> 



More information about the grass-user mailing list