[GRASS-dev] v.breach and v.line.center GRASS addons
Maciej Sieczka
tutey at o2.pl
Wed Mar 14 14:29:46 EDT 2007
Dylan Beaudette wrote:
> Great work Maciej!
>
> On Tuesday 13 March 2007 13:06, Maciej Sieczka wrote:
>> Hi
>>
>> I have submitted 2 new scripts for GRASS 6.x to GRASS WIKI
>> http://grass.gdf-hannover.de/wiki/GRASS_AddOns:
>>
>> v.line.center creates a points vector map with each point located in
>> the middle of the length of one input vector line.
>
> So this script locates a line's midpoint, and puts a new point there?
Yes.
> Does this point have the same attributes as the line which was used as the input?
It does not copy the attributes (I didn't need that and had no time for
that), but it preserves the category numbers. And since there is one
output point per one input line, you can use the db.copy and
v.db.connect to attach a table of the input vector to it.
Any layer can be used for input. But due to v.segment, the output will
always be in layer 1. I guess v.category option=chlayer could help
here, if needed.
There is a brief manpage provided with the script.
>> v.breach creates vector maps of lines and points of continously
>> lowering elevation down the input watercourses, based on the input
>> raster DEM.
>>
>>
>>
>> v.line.center is a simple self-explanatory tool.
>>
>> v.breach is more complex. It is similar to r.carve -n, with the
>> following differences:
>>
>> 1. It takes the direction of input vector lines into account; which
>> means it is less prone to artifacts in the input DEM but more demanding
>> to input watercourses. As a result you can breach DEM even against the
>> slope, if that's needed ;).
>
> cool. any examples yet?
Nope. I have tested it and it worked. Let me know in case of any problems.
>> 2. It does not breach the DEM itself, but outputs vector points which
>> have the breached elevation attribute stored in the table. These points
>> can be used as additional data for interpolating more hydrologicaly
>> sound DEM from scratch, or rasterized and burned into the input DEM
>> manually (v.to.rast, r.mapcalc).
>>
>> 3. It also outputs vector lines, which are the input vector
>> watercourses segmented one segment per each DEM cell through which a
>> given input watercourse flows. Those segments have the breached
>> elevation attribute same as the output vector points. I needed such
>> output for my work. Maybe it will be of some use for others.
>>
>> 4. It is way slower than r.carve. Shell (I have got rid of bashisms I
>> hope) + Awk + standard UNIX tools.
>>
>> See the v.breach manual for more details.
> Did this approach allow you to use RST in complex terrain with drainage
> enforcement- to create a better DEM than was previously possible? I recall
> severall discussions pertaining to the creation of DEM from difficult input
> points, specifically with the RST interpolator.
I haven't tried it with RST interpolator.
> Looking forward to trying these new modules soon,
Cheers! Please drop me line how it went.
A note which I forgot to add previously:
v.breach is EXTREMELY verbose. I did not have time for testing how the
silent flag and GRASS variables for verbosity control would affect the
module performance in GRASS 6.2.1. I seem to remember that not all the
verbosity control measures are available inb 6.2.1 which are 6.3 (I use
6.3 in my daily work). I will be grateful for suggestions which of the
verbosity control stuff I could use in v.breach not to break it for
6.2.1, or if there is actaully nothing to be affraid of.
Maciek
More information about the grass-dev
mailing list