Hacker News new | ask | show | jobs
by tomglynch 1833 days ago
Does anyone know if there is a map app that allows the user to change route weighting options?

For example, as a cyclist who enjoys riding both gravel roads and low traffic sealed roads, I'd like to be able to weight these types of roads above bike paths and main roads.

I've been looking for something like this for a while but I'd also be willing to build something out if say mapbox or another mapping platform has the options to allow route weighting. Does anyone know if this is the case?

4 comments

You can do this with OSMAnd, last I knew with both the internal routing engine and also with BRouter.

You can create a custom routing profile, and also compile maps using your own data transforms (so if the maps that they produce don't include some information from OSM that you value, the software is flexible enough to make different maps just with configuration).

The profiles that ship in the app are defined in https://github.com/osmandapp/OsmAnd-resources/blob/master/ro...

> compile maps using your own data transforms (so if the maps that they produce don't include some information from OSM that you value, the software is flexible enough to make different maps just with configuration)

Could you please elaborate a bit on that sorcery? I've never heard of this possibility, so don't even know where I would read up on it or what keywords to search for. (Though in retrospect of course it makes sense that someone would figure out how to make maps for open-source software.)

They provide the tool to do it: https://docs.osmand.net/en/main@latest/development/map-creat...

There's a brief section there on the configuration files. The ones used for the maps they published are at https://github.com/osmandapp/OsmAnd-resources/tree/master/ob...

(I'm not sure they are the exact files used for the published maps, they are at least close)

You'd then have to edit the rendering styles and such to take advantage of the new data.

Thanks!
brouter (http://brouter.de/brouter-web/) is a web interface for customisable bike routing.

Generally the trade-off for customisable routing is speed. If weightings are fully adjustable, you can't easily calculate routing shortcuts, so you have to explore the full graph each time (within the constraints of the broad area you're routing through).

I run https://cycle.travel/ which isn't customisable but is pretty fast, because the routing algorithm it uses (Contraction Hierarchies, via the OSRM routing engine) precalculates shortcuts. It likes low-traffic roads and traffic-free trails - you might find it to your tastes.

For GraphHopper Maps we recently released version 3.0 where we also developed a simple online demo (target audience are developers :) ) of our customizable routing feature: https://www.graphhopper.com/blog/2021/05/18/graphhopper-rout...

One example link that prefers bike network and avoids bigger roads:

https://graphhopper.com/maps/?point=Potsdam%2C%20Deutschland...

You can self host GraphHopper or use our API and integrate it into your app. For newer Androids it should also work offline on the device.

OSRM allows you to make considerable customizations using your own Lua routing profile, even pulling in your own data sources into the mix.