[GRASS-PSC] GRASS add-on sharing and write access
Markus Metz
markus.metz.giswork at gmail.com
Sun Dec 17 12:14:42 PST 2017
On Sun, Dec 17, 2017 at 5:36 AM, Anna Petrášová <kratochanna at gmail.com>
wrote:
>
> Hi Nagy,
>
> On Sat, Dec 16, 2017 at 2:06 PM, Nagy Edmond <nagy.edmond.eno at gmail.com>
wrote:
> > Hi Anna,
> >
> > Thank you for pointing that out. It always computes one way between two
> > points indeed, but there is something that I should bring to light.
> >
> > While I was initially computing least-cost paths with r.drain using
r.walk
> > outputs as inputs I noticed a possible problem. I ran two parallel tests
> > with the same two points. In the first one, A was the starting position,
> > while B the stop position. In the second one, B was the start point and
A
> > the stop point. In r.walk, the results were anisotropic indeed, both the
> > walking cost and the movement direction raster outputs turned out
different,
> > as it would have been expected. But the r.drain module sadly did not
> > generate different least-cost paths, despite using different inputs. I
have
> > also checked this more than once, just to be sure of it.
> >
> > At one point I have also come across an article (Gietl et al. 2008 -
link
> > below) where the authors discuss and compare l.c.p. results obtained
with
> > different GIS (including GRASS), and they had also experienced some
problem
> > with the module (page 4), but I am not sure if it's the same I'm
having. In
> > any case, if nothing can be done about it, then I will mention the
> > limitation in the documentation.
> >
>
> you are right that r.drain seem to create the same path from A to B
> and back, there are some slight differences, but that can be just
> numerical cause. I am not sure why is that, if my expectation that the
> path for that DEM should be different is incorrect, or there is some
> problem in the algorithm.
It depends on the slope factor. Here is an example, based on the example in
the manual of r.walk (North Carolina sample dataset):
g.region region=swwake_30m -p
# create friction map based on land cover
r.recode input=landclass96 out=friction rules=- << EOF
1:3:0.1:0.1
4:5:10.:10.
6:6:1000.0:1000.0
7:7:0.3:0.3
EOF
r.walk -k elevation=elev_ned_30m friction=friction output=walkcost_ab
outdir=walkdir_ab start_coordinates=635576,216485
stop_coordinates=640206,222795 slope_factor=-0.05 lambda=0.5
r.drain -d input=walkcost_ab direction=walkdir_ab output=path_ab
drain=path_ab start_coordinates=640206,222795
r.walk -k elevation=elev_ned_30m friction=friction output=walkcost_ba
outdir=walkdir_ba start_coordinates=640206,222795
stop_coordinates=635576,216485 slope_factor=-0.05 lambda=0.5
r.drain -d input=walkcost_ba direction=walkdir_ba output=path_ba
drain=path_ba start_coordinates=635576,216485
Here, the paths from A to B and from B to A are different. Depending on the
settings, the paths can be nearly identical. Small differences can arise
because there can be several paths from A to B with equal cumulative costs.
> I don't think what the paper refers to is
> the same thing though.
In this paper, GRASS 6.1.0 was used, and back then r.drain did not have the
option to use a direction map as input, therefore r.drain could not be used
with the output of r.cost/r.walk.
Right now, r.drain is somewhat overloaded: it creates directions for a DEM
same way r.fill.dir does it, or it uses supplied directions, then the
module extracts least costly paths. I suggest to have a new module r.path
that extracts extract least costly paths from input directions and start
points and mark r.drain as deprecated.
Markus M
>
> Anna
>
> > All the best,
> > Nagy Edmond
> >
> > article -
> > http://proceedings.caaconference.org/paper/106_gietl_et_al_caa2007/
> >
> >
> >
> > --
> > Sent from: http://osgeo-org.1560.x6.nabble.com/GRASS-PSC-f4051248.html
> > _______________________________________________
> > grass-psc mailing list
> > grass-psc at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/grass-psc
> _______________________________________________
> grass-psc mailing list
> grass-psc at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-psc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-psc/attachments/20171217/680e91f2/attachment.html>
More information about the grass-psc
mailing list