[GRASS5] r.profile
Hamish
hamish_nospam at yahoo.com
Wed Sep 28 07:32:55 EDT 2005
> > > after toying around with the enhanced version of r.profile (great job,
> > > Bob!) I wonder if there's an _elegant_ way to pipe any output from
> > > v.out.ascii into r.profile.
> > >
> > > This is trivial for vectors consisting of just one line, but for
> > > multi-line vectors manual editing is still needed.
> >
> > I wouldn't call it elegant, but:
...
> v.out.ascii multi_line format=standard | sed -e 1,10d | \
> grep -v ' 1 ' | tr '\n' ',' | sed -e 's/,L/\nL/g' | \
> cut -f2- -d',' | sed -e 's/^ //' | tr ' ' ',' | \
> sed -e 's/,,/,/g' | sed -e 's/,$//' > ascii_lines.tmp
>
> g.region rast=raster_map
> LINE_NUM=1
> for LINE in `cat ascii_lines.tmp` ; do
> r.profile -gc in=raster_map profile=$LINE > line_${LINE_NUM}.prn
> LINE_NUM=$(($LINE_NUM + 1))
> done
The next step is to pipe these into v.in.ascii points,
v.in.ascii in=line_1.prn out=line_1_pts fs=space \
columns='x double, y double, distance double, value double, GRASSRGB varchar(11)'
...and display with fill color of the symbol taken from the new RGB
value (which was taken from the original raster map).
To do this we apply Martin Landa's d.vect GRASSRGB patch for lines
and points. (combined unidiff vs. latest CVS attached) see also:
http://grass.itc.it/pipermail/grass5/2005-September/019563.html
Then plot with 'd.vect -a'. The results look quite nice. (see attached png)
[alternatively/comparatively use d.vect.thematic]
summary:
raster + vector line(s) + segmentation_distance
=> regularly spaced colored markers along track of line with
colors taken from raster map. Use with d.legend.
e.g. plot some value along GPS track.
To finish this chain of tools we still need GRASSRGB support in ps.map,
... anyone?
Another idea is to use this to help visualize Radim's LRS,
http://mpa.itc.it/radim/lrs/index.html
perhaps combined with a raster made with r.cost.
Hamish
-------------- next part --------------
A non-text attachment was scrubbed...
Name: d_vect_rgb_column.diff.gz
Type: application/octet-stream
Size: 4358 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20050928/e6ca3d55/d_vect_rgb_column.diff.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: profile_rgb.png
Type: image/png
Size: 8967 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20050928/e6ca3d55/profile_rgb.png
More information about the grass-dev
mailing list