As Geoapify provides API and solutions for geospatial products, we constantly looking for new technologies and opportunities. This time we looked towards Graphhopper Routing Engine and especially its Isoline API.
In this article, we would like to acquaint you with GraphHopper and share with our some of our results and conclusions.
Graphhopper Routing Engine
GraphHopper is a free open source routing engine that you can run on your computer. By default, it uses OpenStreetMap and GTFS data. Still, it can import information from other data sources.
You can assess and try its functionality on GraphHopper's official playground. There you can experiment with its various APIs, which include, but not limited to:
- Routing API
- Route Optimization API
- Geocoding API
- Map Matching API
- Isochrone API
- Matrix API
Important to say that not all of the above mentioned APIs are available for free when you start GraphHopper from its sources. The Matrix API, for example, is presented in the playground for demonstration purposes only and is part of commercial services provided by GraphHopper GmbH company.
Isoline, isochrone, isodistance
Nevertheless, I was interested in experimenting with GraphHopper's Isoline API, which supports both Isochrone and Isodistance functionality, and compare its result with the output of the similar open-source tool as Valhalla .
NOTE: For people, who are new to the GIS-related topics, an isochrone of a particular location (as Wikipedia says) is "a line connecting points at which a vehicle arrives at the same time." In turn, isodistance is "a variant of isochrone connecting places that are the same distance from a particular place."
GraphHopper Isoline API results
Results for the 20 minutes isochrone from the center of Munich can be observed in the below image:
What to say: looks like different routers are using different car speed limits by default and might ignore the speed limits of the particular streets. I don't want to judge it. What was more important for me in my exercise is the quality of the returned geometry in geojson terms.
First, what we can see from the GraphHopper output is, that sometimes it ignores completely or partially the presents of parks, lakes, and areas which are not reachable with the car.
Second, it returns a geometry as a Polygon type, vs. MultiPolygon returned by Valhalla, for example. As result, it cannot cut some areas from the final result, even if it knows that this might be an area that is not reachable.
Third, the presence of the sawtooth lunges on the geometry border. That might be a side effect of the second issue when GraphHopper has to join some reachability points on the map across a zone with limited access, as parks or forests for example.
A final note is about calculation speed. On my hardware, it is around two-three times slower than Valhalla. Of cause, partially it might be related to the fact, that GraphHopper tries to drive almost twice far away from the original point as Valhalla does.
It is not worth trying to use GraphHopper for your needs if you need some of its APIs, which are not available in the other routers yet. Still, there are plenty of places for improvement which you can decide to wait, especially taking into account that the GraphHopper is an actively developed open-source project backed up by the commercial company which provides managed services on top of their open-source core.