[GRASS-dev] r.stream.basins: issues with points on other layer than 1

Hi,

I had some trouble with r.stream.basins which labeled all basins created with points option as -1.

After some investigation I found out that the problem was that my vector points map only had categories on layer 2.

After transferring the categories to layer 1 everything worked fine. During my test with NC dataset I also saw that if there only some points on a layer have a category, no basin is produced for the points without category; even if the message of the module says differently.

The latter can be reproduced with NC data like this:

g.region -p raster=elev_lid792_1m

r.watershed elevation=elev_lid792_1m accumulation=flow_accum drainage=draindir

echo "638867.632469|220039.545432|7

638563.344273|220045.597694|12

638945.422741|220706.456664|999

638978.525142|220455.417819|" | v.in.ascii input=- output=points columns=“cat integer” cat=3 --o

r.stream.basins --o --v -c direction=draindir points=points memory=3000 basins=basins

From that experience I would like to suggest either

a) Adding a layer option to the module

b) Give at least a warning if features in the vector map are lacking a category

c) Clarify the behavior in the manual

or maybe a combination of a-c…

I could assist with c)…

What do you think?

Cheers

Stefan

On Thu, Dec 29, 2016 at 11:07 AM, Blumentrath, Stefan <Stefan.Blumentrath@nina.no> wrote:

Hi,

I had some trouble with r.stream.basins which labeled all basins created with points option as -1.

After some investigation I found out that the problem was that my vector points map only had categories on layer 2.

After transferring the categories to layer 1 everything worked fine. During my test with NC dataset I also saw that if there only some points on a layer have a category, no basin is produced for the points without category; even if the message of the module says differently.

If a module accepts a vector as input, there should (if feasible) also be the options layer, cats, where in order to optionally select a subset of vector features. Can you please add a ticket for r.stream.basins that these options need to be added, with layer=-1 meaning that basins must be created for all points, even if they have no category value? Thanks!

Markus M

The latter can be reproduced with NC data like this:

g.region -p raster=elev_lid792_1m

r.watershed elevation=elev_lid792_1m accumulation=flow_accum drainage=draindir

echo "638867.632469|220039.545432|7

638563.344273|220045.597694|12

638945.422741|220706.456664|999

638978.525142|220455.417819|" | v.in.ascii input=- output=points columns=“cat integer” cat=3 --o

r.stream.basins --o --v -c direction=draindir points=points memory=3000 basins=basins

From that experience I would like to suggest either

a) Adding a layer option to the module

b) Give at least a warning if features in the vector map are lacking a category

c) Clarify the behavior in the manual

or maybe a combination of a-c…

I could assist with c)…

What do you think?

Cheers

Stefan


grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev