[GRASS-dev] How to sample raster values along a vector line?

Moritz Lennert mlennert at club.worldonline.be
Fri Mar 11 00:02:42 PST 2016


On 10/03/16 18:56, Markus Neteler wrote:
> Hi devs,
>
> I somehow don't get how to sample values from a raster map along a
> vector line which is several pixels long.
> In essence, something like this
> #1852: r.profile: accept lines vector map as profile
> https://trac.osgeo.org/grass/ticket/1852
>
> Issues:
> - I tried v.split but don't know how to extract the nodes from the
> resulting map.
> - I also tried v.to.points but the distance is "random". Try this:
>
> # NC data
> v.to.points railroads output=railroads_nodes use=node dmax=200
>
> g.region vector=railroads_nodes
> d.mon wx0
> d.vect railroads_nodes
> --> ??

This is the expected result with use=node. Try without that, and you 
should get what you are looking for:

v.to.points railroads output=railroads_nodes dmax=200

Moritz


More information about the grass-dev mailing list