This repository contains a simple REST proxy based on the awesome GeoPy-Project. The goal is to have a REST-interface which provides the main API-Endpoints that Photon (API-Documentation at Komoot) and Pelias (API-Doumentation Forward, API-Documentation Reverse) have to offer and can act as simple replacement for these two services.
Responses of the GeoPy-REST-Proxy are valid GeoJSON though different and somewhat simpler than e.g. the responses of Photon and Pelias. The raw results of the upstream geocoder can be included as well.
For the Mobidrom Routing Services we wanted to achieve some flexibility regarding which geocoding service is used for geocoding requests. This should allow us to replace the currently used Photon e.g. with Pelias or Nominatim as upstream geocoder anytime in the future or add a specialized geocoder for public transport stops.
The proxy already does allow authorization of the API using an API-Token (set from an environment variable) in order to avoid unrestricted usage. In the future "proper" user authenication will be added especially to also support the following usage scenario
While the Mobidrom Routing Services are made available in a non-discriminatory way it is relevant to see who is using which service and how often as well as to separate internal (Mobidrom Routing Services itself, Verkehr.NRW) and external users. Thus if the environment variable ENABLE_METRICS is set to true the proxy exposes a /metrics endpoint for Prometheus where relevant information can be scraped by Prometheus