Elevation providers cannot contribute to info.copyrights
Summary
info.copyrights is a static list from GraphHopperConfig, and no elevation provider can add to it. So a client has no way to learn whose terrain data shaped a route — for any provider, not just one.
Note this is not limited to responses that return elevation. Once a graph is imported with an elevation provider, the DTM shapes every route from it: average_slope / max_slope custom models weight by it (per docs/core/elevation.md), and ascend / descend are derived from it. A client that asks for elevation=false still gets a path computed from that data. The attribution therefore belongs to the graph, not to the response flag — which is also why merging the provider's list into info.copyrights unconditionally (proposal 1 below) is the right shape.
Current behaviour
GraphHopperConfig seeds the list, and nothing else ever writes to it:
public GraphHopperConfig() {
// This includes the required attribution for OpenStreetMap. Do not remove it.
copyrights.add("GraphHopper");
copyrights.add("OpenStreetMap contributors");
}RouteResource, IsochroneResource, PtRouteResource and PtIsochroneResource all emit config.getCopyrights() unchanged, and a repo-wide search for copyrights has no hits under core/src/main/java/com/graphhopper/reader/dem.
A POST /route with "elevation": true returns 3D coordinates, and reports the same two entries it would for a request that asked for none:
"info": {"copyrights": ["GraphHopper", "OpenStreetMap contributors"], "took": 159}Why it matters
Several supported providers carry attribution obligations that the project already acknowledges in prose but cannot express through the API:
SkadiProviderjavadoc: "See https://github.com/tilezen/joerd/blob/master/docs/attribution.md for required attribution of any project using this data."docs/core/elevation.mdon Mapterhorn: "As it contains many sources the attribution is a longer list that you can find here."- Sonny (#2823, added in #3183) is the sharpest case: it is a composite of national agency datasets whose licences (DL-DE/BY-2.0, OGL v3 and others) each ask for their own source line.
For scale — we run a self-hosted instance whose elevation provider is Sonny. Asked about that same dataset, our own attribution resolver returns 8 credits for a point in Scotland and 18 for one in Germany. info.copyrights returns 2.
Workaround, and why it is poor
setCopyrights is a public setter, so an operator can set copyrights: in config.yml. But it replaces the list rather than extending it — including the OpenStreetMap entry the code explicitly says not to remove — and it is graph-wide, so every response would carry every source in the graph even for a route confined to one country.
Proposal
- Let the configured
ElevationProviderexpose an attribution list that is merged intoinfo.copyrights, additively, leaving the defaults in place. This is cheap and would be enough to discharge the obligation. - Ideally, report only the sources the returned path actually used. This is much harder — elevation is baked into the graph at import time and per-edge provenance is not retained — so it seems a stretch goal rather than a prerequisite for (1).
#2806 added road_data_timestamp to info to carry OSM data provenance; this is the same idea applied to elevation.
Source: graphhopper/graphhopper