[pgrouting-users] Generating route loops, Removing sticking-out bits

Greg Allensworth gregor at greeninfo.org
Fri Jul 27 11:42:07 PDT 2012


On 7/27/2012 10:56 AM, Steve Horn wrote:
> I think your idea will work, except the case when you are returning to
> the starting node. Although that could be easily solved by saying "don't
> travel any edges I've already traveled, /unless/ my target is my home base".

Hey, good thinking there. That does mean other spurs on the last leg, 
but that's a lot better; and if I add more waypoints or contrive the 
last one to be closer to home than the others, the stretchb in which 
spurs may occur is narrowed further. Thanks for the thought.


> Another thought is to possibly remove the edges from the route that are
> duplicated, and then run shortest_path for the places where you have
> missing edges

Interesting. I'm iterating over the solution vertices anyway to find <2 
links, could keep track of the node-IDs of "the last kept node" and then 
"the first kept node after a series of deleted nodes" Hmmmmm.

And then do a shortest-path from the final node to the start, to close 
the loop. Double-hmmmmm. Again, thanks for the thought.


> These solutions may restrict your walking paths too much though. There
> are some edges in your graph that actually require U-turns. Is it
> acceptable to exclude those outright?

Yes. The effect of WP #5 there, where it weighted the route but didn't 
in fact fall into the path, is just great. It's the breaks that we don't 
like, and the whole missing segments for some other more-complicated cases.


I'll be a few days on other projects before I get back to this one. I'll 
let you know how it works out. Good food for thought here.

-- 
Greg Allensworth, Web GIS Developer
BS  A+  Network+  Security+  Linux+  Server+
GreenInfo Network - Information and Mapping in the Public Interest
564 Market Street, Suite 510  San Francisco CA 94104
PH: 415-979-0343 x302  FX: 415-979-0371    email: gregor at greeninfo.org
Web: www.GreenInfo.org     www.MapsPortal.org

Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org


More information about the Pgrouting-users mailing list