[GRASS-user] get values for each point within lines

Markus Metz markus.metz.giswork at googlemail.com
Wed Feb 15 03:03:53 EST 2012


Milton Cezar Ribeiro wrote:
> Dear Grass gurus
>
> I have a vector map with lines, and I need to get raster values each 5 meters.
> So I used v.split to spring my lines in segments of 5 meters, and
> after that I used
> v.to.points to generate points on each node of my line segments.
>
> Now I am trying to overlap my points against a elevation map, but when I run
> v.what.rast vect=lines_split_05m_points rast=dem col=elevation
>
> the numbers of records on my v.db.select is the same of my lines
> instead of my points.
>
> The question is how to get the elevation values and keep the other
> attributes from my source line.

You need to add unique categories for the points in a new layer with
v.category option=add.
Then transfer the original line attributes from the original layer to
the new layer with v.to.db, finally run v.what.rast.

HTH,

Markus M


More information about the grass-user mailing list