Display osm road network in offline mode

I am running GH on a private network and am supplying GH my custom made road network:

java -jar graphhopper-web-0.7-SNAPSHOT-with-dep.jar jetty.resourcebase=webapp config=config-example.properties osmreader.osm=turtleRock.osm

When I run the GH and go to http://localhost:8989/ I do not see my road network displayed. Yet if I click a start point and an end point the routing engine sees my network of roads. How do I get GH to display my supplied road network ?

GraphHopper web uses external address search and external tiles services not baked by the internal road network. You can try MiniGraphUI (swing/desktop) and there you should see your custom road network.

can anyone give an example of using miniui? I have tried

./graphhopper miniui mymap.osm.pbf

but that’s not how you do it.
EDIT: my goal is to view the network that graphhopper is using for its calculations

Yes, this was possible at a certain time via the script. Now you should be able to use it via a java command directly:

cd graphhopper
git checkout 0.11
mvn clean install
java -cp tools/target/graphhopper-tools-0.13-SNAPSHOT-jar-with-dependencies.jar com.graphhopper.ui.MiniGraphUI graph.location=graph-cache datareader.file=berlin-latest.osm.pbf graph.flag_encoders=car

Or if you are interested in latest cutting edge version using vector tiles directly from GraphHopper storage (from few hours ago :wink: ), then you can try this branch: https://github.com/graphhopper/graphhopper/tree/experimental-mvt with the help of a special leaflet plugin.

1 Like

You can also use this: https://github.com/easbar/graphhopper-graphtool
It’s rather prototypical but you can draw a bounding box and see the nodes/edges of the GH graph.


wow, thats good stuff

@easbar I am now looking at your project graphhopper-graphtool. I installed a local tile server TileServer GL (tileserver-gl v2.5.0)an open-source project from Klokan Technologies GmbH and its running at localhost:8080. In defined the tiles url in src/config.js to be

export const tilesUrl = 'http://localhost:8080/';

but that is not right, I guess, because after running npm run watch I get a white canvas.

Ok I have not tried with local Tile server gl yet.
I am using: https://free.tilehosting.com/styles/streets/style.json?key=xyz
where xyz is a key specific to the (free) account I got at maptiler.com.

1 Like

Ok, that works. Now I see tiles and I see a bounding box that seems to be correct. I also have your graphhopper running at localhost:8989. I was expecting to see the edges and nodes of the graphhopper representation of my osm map, but apart from the tiles I don’t see anything.

One step back: what can I do with graphhopper-graphtool and is there a documentation?

EDIT: sorry, it works!
EDIT: that’s pretty. Can it also display routes?

EDIT: sorry, it works!

nice! glad to hear :slight_smile:

EDIT: that’s pretty. Can it also display routes?

no not at the moment. I have implemented this in some local branch, might push this in a few days. when you have the gh server running you can use its maps ui to show the routes (in a separate browser tab, not ideal I know).