Reporting the cost of a route for several metrics

46 views
Skip to first unread message

Guillaume Barreau

unread,
Dec 7, 2011, 1:23:47 PM12/7/11
to Graphserver
Hi,

I have just disovered the existence of this project and I would like a
quick assessment of whether it would be useful for what I am trying to
do.

Along with typical shortest routes, I want to find routes that
minimize the sum along the path of another value associated with my
edges. How difficult would it be to minimize one metric (say distance)
and have the sum of the other one reported as well? I am only
interested in cycling here so I am not really using the multi-modal
aspect of GraphServer.

In ArcGis, this is fairly straightforward to set up, is it too with
GraphServer?

Thanks,

Guillaume

Andrew Byrd

unread,
Dec 10, 2011, 1:42:26 PM12/10/11
to graph...@googlegroups.com
Hi Guillaume,

I know you've also been considering OpenTripPlanner for this problem, so
here's some context and comparison.

Much of the OpenTripPlanner core routing module began life as a Java
port of the Graphserver core -- you may even spot some of Brandon's
comments from Graphserver hanging around in the OTP code. Though
development activity and discussion on this list has slowed down in
recent months, I would say Graphserver is still an excellent option for
transportation path search problems. Graphserver is more general than
OTP, and in some ways lends itself more easily to customization as long
as you are comfortable working in C with Python bindings (or straight
C), and are willing to modify the source code.

For the same task, it is probably faster and almost certainly less
memory-hungry than OTP, and reflects a preference for a compact,
elegant, close-to-the-metal approach. Many people (myself included) have
used Graphserver as a starting point for research tools and embedded
applications, etc.

Python scripts are provided to build the street graph from OpenStreetMap
way data and (optionally) elevation raster data loaded into SQLite
databases. These scripts would serve as examples and a starting point
for loading streets from alternate sources or augmenting the street
graph with data from an arbitrary raster (see pygs/graphserver/ext/ned/).

As for C source modifications, you would need to add a new field to
struct Street and add get/set functions for that field (and Python
bindings for them). Then, in streetWalkGeneral() in street.c, add a
value proportional to the contents of that field (probably multiplied by
elapsed time if we are talking about pollutant concentrations) into the
weight of the return state.

If you want to report the sum of the new field over the entire search,
you need to add a new field to struct State and accumulate pollutant
exposure into that new field, again in streetWalkGeneral(). Add a get
function and Python bindings for this new State field so you can read
the accumulated value from the best (lowest-weight) state at the
destination.

-Andrew

Guillaume Barreau

unread,
Dec 11, 2011, 5:51:24 AM12/11/11
to graph...@googlegroups.com
Hi Andrew,

Ah, I have been recognized!
Thanks very much for this very helpful reply. Indeed I have done a bit more exploration of graphserver and found it much closer to the metal as you say. Your pointers to how I can go about doing what I have to do will be very very helpful.

I have also been considering adapting bikesy for my purpose with the advantage that I get a UI out of the box which I don't otherwise have with the standard graphserver. I guess it is probably not very difficult to build a UI but still if I can save myself the effort ...

I will keep you posted on my progress.

Guillaume



--
You received this message because you are subscribed to the Google Groups "Graphserver" group.
To post to this group, send email to graph...@googlegroups.com.
To unsubscribe from this group, send email to graphserver+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/graphserver?hl=en.


Reply all
Reply to author
Forward
0 new messages