Skip to the content.

Back to Index

Further Features: geocode provider - Graphhopper

The graphhopper service provides multiple services. Geocode service is just one of them.

This service requires an API_KEY. So if you want to use it, you have to register on https://graphhopper.com/dashboard/#/login. You can get a token with an API_KEY for free, which allows at least several hundred Geocode requests a day. You have to put one line in your “Graphhopper.cfg” configuration file:

API_KEY=<your_registered_API_KEY>

The implementation for the Graphhopper search engine doesn’t provide the option to restrict the search results to a given bounding box or circle. The number of result is limited to 5. The big advantage of graphhopper is that it provides the ability for autocompletion. It even allows to autocompletion for multiple terms.

This implementation is using the geocode API https://graphhopper.com/api/1/geocode As soon as the search text length exceeds 5 character, the search will be started.

So after “Haupts” is the result somewhere in the world:

 

But after “Haupts Hei” the “Hauptstraße” in Heidelberg is already found.

 

With “Haupts 20 Heidel” we are able to find the correct position of address “Hauptstraße 20, Heidelberg”.

 

Graphhopper supports also reverse geocoding. It’s the same API as above, just with an additional parameter: reverse=true.
A long press on the position of “Hauptstr 20, Heidelberg” delivers following result:

 

Summary

The search results, forward and reverse are both with quite good quality. The autocompletion is the best I have seen up to now.

Back to Index