Updates

Just re-compiled GRASS with Colin's recent patches to r.cost, r.drain, and r.walk. Compiles fine against develbranch_6 on linux, with visibly different results. Using the output direction update to r.cost/r.drain does not appear to differ much from the original implementation. The results from r.walk/r.drain using the output direction patch results in considerably differences-- that appear to be non-optimal in this terrain.

# re-compute with patched modules
r.walk -k elev=elev friction=friction output=walk.cost.new outdir=walk.dir start_points=start stop_points=end lambda=1
# Peak cost value: 14030.894105
r.cost -k in=slope output=cost.new outdir=cost.dir start_points=start stop_points=end
# Peak cost value: 11557.934493

# compute shortest path from start to end points
r.drain -d input=walk.cost.new indir=walk.dir output=walk.drain.new voutput=path_1_new vector_points=end
r.drain -d input=cost.new indir=cost.dir output=cost.drain.new voutput=path_2_new vector_points=end

# add DB column for length calculation
v.db.addtable path_1_new
v.db.addtable path_2_new

v.db.addcol path_1_new columns="len double"
v.db.addcol path_2_new columns="len double"

# how long are the two paths?
v.to.db path_1_new option=length column=len units=me
# 4848 meters
v.to.db path_2_new option=length column=len units=me
# 7000 meters

# map
d.rast shade
d.vect start icon=basic/circle fcol=green size=15
d.vect end icon=basic/circle fcol=red size=15
d.vect path_1 width=1 col=blue
d.vect path_2 width=1 col=orange
d.vect path_1_new width=2 col=blue
d.vect path_2_new width=2 col=orange

Updated Shortest Path Evaluation: The thin lines correspond to the default behavior of r.walk/r.cost and r.drain, the thick lines are the updated versions by Colin.Updated Shortest Path Evaluation: The thin lines correspond to the default behavior of r.walk/r.cost and r.drain, the thick lines are the updated versions by Colin.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <div> <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.