[GRASS-user] elevation profile
John Callahan
john.callahan at udel.edu
Wed Jul 28 15:48:16 EDT 2010
Thanks to everyone for their responses. I did not try all the methods. One
method that did work (and was mentioned more than once) was basically:
v.to.points (convert 2d lines to points)
v.out.ascii (export coordinates to txt file)
cat "coords.txt" | r.profile (input text file coords to r.profile)
However, this worked for only one line/path at a time (by using SQL where
clause with an attribute unique to each path) and I had a shapefile with
about 20 paths. Likely this could have been scripted to process
efficiently. Unfortunately, I'm still learning the basics of GRASS and did
not want to get into scripting yet!
I went with SAGA in the end. Thanks Ricardo for that suggestion! It
worked great and had exactly what I wanted. Also, it's a good idea to start
with a clean line vector dataset, regardless of which method you choose. It
took a fair bit of time to snap/merge several line segments together to get
my paths to come out right. Thanks again.
- John
**************************************************
John Callahan, Geographic Information Scientist
Delaware Geological Survey, University of Delaware
URL: http://www.dgs.udel.edu
**************************************************
On Fri, Jul 16, 2010 at 4:15 AM, Francesco Mirabella <mirabell at unipg.it>wrote:
> Hi,
> I had a similar issue while extracting an elevation profile for a river. I
> think it's similar to your problem.
>
> Afaik v.drape produces x,y,z vector map, if you need to export it, maybe
> you should use v.out.ascii. However, v.drape gives coordinates of points,
> NOT the distance between each point which I think you need if you want to
> get an elevation profile (distance vs elevation). To do this I suggest the
> following:
>
> v.out.ascii of your 2d vector (road)
> cat output_of_v.out.ascii | r.profile input=your_dem
> output=elevation_profile
>
> Hope it helps
> cheers
> Francesco
>
>
>
>
>
> Hamish wrote:
>
>> yet another two methods to try-
>>
>> (spearfish dataset)
>>
>> # v.out.ascii | r.profile method
>>
>> g.region -d
>> v.in.region sp_box
>> v.type in=t_powerlines out=t_powerline type=boundary,line
>> v.overlay ain=t_powerline bin=sp_box out=sp_powerline atype=line op=and
>> v.build.polylines in=sp_powerline out=sp_powerline_pl
>> g.remove v=sp_box,t_powerline,sp_powerline
>>
>> v.out.ascii in=sp_powerline_pl format=standard | grep '^ ' | \
>> r.profile -g in=elevation.dem res=30
>>
>>
>>
>> # v.to.rast MASK method
>>
>> v.type in=t_powerlines out=t_powerline type=boundary,line
>> v.category in=t_powerline out=t_powerline_with_cat option=add
>> v.to.rast in=t_powerline_with_cat out=MASK use=val value=1
>> g.remove v=t_powerline,t_powerline_with_cat
>>
>> r.out.xyz elevation.dem
>> g.remove MASK
>>
>>
>>
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100728/8ad32c04/attachment.html
More information about the grass-user
mailing list