[GRASS5] v.profile for 5.1?

Radim Blazek blazek at itc.it
Thu Jul 17 02:30:40 EDT 2003


On Thursday 17 July 2003 03:28, H Bowman wrote:
> I was thinking about a module that would provide an elevation profile
> along a track/road, and was curious to know if this could be easily done
> with the vector improvements in 5.1.
>
> Basically I'd like to have r.profile use a masked vector file to
> automatically set r.profile profile=east,north[,east,north,east,north,...]
>
> Currently this might be done with v.out.ascii or v.to.sites and some
> text editor magic, but this is a pain and I'd suspect there'd be a limit
> to the number of vertices you could feed the command line.
>
> This might also be a way to label each point of a 5.1 vector with an
> elevation attribute to make a 3d vector from a 2d vector and a DEM. (???)


My idea for this was to have one module which would drape 2D over
DEM and write 3D vector (v.drape.dem) and another one which would write
profile for 3D vector as ASCII and maybe PS (v.out.profile). 
That way, it would remain enough general, which is better, 
because 3D vector may be also result of other modules 
(v.drape.tin once written, imported vector, ...) and v.drape.dem
may be also used for other purposes (before v.out.pov for example)

That for future, but I think that you can do something similar 
already now using v.what.rast and v.distance. Say that you have
in 5.1 vector 'line' with input line, vector 'points' generated
from 'line' by v.to.sites (in 5.0) with attached table with columns
'distance' and 'height' and raster 'dem'. Then you can do

# upload heights for points to table
v.what.rast vect=points rast=dem col=height

# upload distance along the line to table
v.distance from=points to=line upload=to_along column=distance

the result is the table with profile stored in columns distance and height.

Radim




More information about the grass-dev mailing list