Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Configurable Default Coordinates for Location Bias #569
We'd like to define a focus lat & lon in pelias.json, and have the Pelias API use that coordinate as the default value for sorting results (e.g., default values for focus.point.lat & focus.point.lon).
If a call to the Pelias API also sends the focus.point.lat=46.5&focus.point.lon=-122.6 URL parameters, then the Pelias API will override the default values for that request.
Even with the smaller regional dataset that the TriMet instance of Pelias will operate with, we still have ambiguous street addresses between towns ... and we want the results a customer sees to be sorted by towns closest to Portland (e.g., the value of our default focus coordinate):
This is probably best accomplished via a new middleware similar to our existing sizeCalculator in API.
You can add the new middleware component to the list in the router code after calcSize and pass
The parameters of interest would be found in
When adding to pelias-config, the new values should go under the
Let us know if you need any help. Looking forward to the PR!