Hi Micha, Thanks for the reply.
I tried your method using the GUI, and it seems one cannot have a from_type of 'line', only of 'point' or 'centroid'. I tried: v.distance from=c83a_rivers_5km to=c83a_rivers_5km_junctions from_type=centroid to_type=point upload=to_attr column=Jname to_column=end_node And got: ERROR: Column <Jname> not found in table <c83a_rivers_5km> Jname is a column in the junctions layer. If I change the last two options around (obviously wrong): v.distance from=c83a_rivers_5km to=c83a_rivers_5km_junctions from_type=centroid to_type=point upload=to_attr column=end_node to_column=Jname I don't get an error but no updates either. I've found another (proprietary) program that can do this, but I was curious to see if it's possible in GRASS. Regards Hanlie 2010/12/9, Micha Silver <[email protected]>: > On 09/12/2010 16:38, Hanlie Pretorius wrote: >> Hi, >> >> I'm working in GRASS 6.4.0 on Windows XP. >> >> I'm creating a hydrological model and am using GIS to prepare the data. >> >> I've split my river layer into about 100 segments and I've digitised >> the start and end point of each river segment on a points layer. >> >> For the points layer, I calculate a 'name' from a prefix and a sequental >> number. >> >> What I would like to do, is to assign for each river segment the name >> of the start node and the name of the end node to the attribute table >> of the river segment layer. >> >> Can anyone give me pointers on how to do this? > I think that v.distance can do this. begin by adding two > attrib columns to your river layer, one for the start node > label, and one for the end node label. Then run v.distance > twice to get the labels from the 'name' column from each of > the node layers. Finally concatenate the two labels together. > So... > # Add columns > v.db.addcol rivers col="start_node varchar(8), end_node > varchar(8), label varchar(16)" > # Use whatever size strings you need > v.distance from=rivers to=end_nodes from_type=line > to_type=point upload=to_attrib column=name to_col=end_node > # and again for the start_nodes > #Now merge the columns > echo "UPDATE rivers SET label=(start_node + end_node)" | > db.execute > # I'm not sure the above '+' will work on all database > connections. With dbf probably not... > >> Thanks >> Hanlie >> _______________________________________________ >> grass-user mailing list >> [email protected] >> http://lists.osgeo.org/mailman/listinfo/grass-user >> >> This mail was received via Mail-SeCure System. >> >> > > > -- > Micha Silver > http://www.surfaces.co.il/ > Arava Development Co. +972-52-3665918 > > _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
