interpolation: integration v1 #769

merged 9 commits into from Jan 24, 2017


None yet
3 participants

missinglink commented Dec 15, 2016

enable the api to request interpolated addresses from the interpolation service.

this PR contains two files:

./service/interpolation.js - provides a client interface to communicate to the service
./middleware/interpolation.js - provides a middleware layer which performs service lookups on applicable hits.

the logic of the adapter is:

  • attempt to connect to the service, if not available then fall back to a no-op callback
  • if a host is not provided by configuration then fall back to a no-op callback
  • time out requests after 1000ms (can be modified via config)
  • three types of transport adapter are provided: null http require

the logic for the middleware is:

  • in the case of any failure simply fall back to what the api would normally reply with
  • if the user didn't request an address, do nothing
  • if the user did request an address and one or more hits were in the street layer then request an interpolation
  • if the service doesn't find a match, fall back to returning the street record unmodified
  • if a result is returned from the service then merge the street hit and the interpolation response properties.

@missinglink missinglink merged commit f034fc5 into master Jan 24, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@missinglink missinglink removed the in review label Jan 24, 2017

@missinglink missinglink referenced this pull request Jan 24, 2017


merge master->staging #786

je-l pushed a commit to nlsfi/pelias-api that referenced this pull request Aug 31, 2017

Merge pull request #769 from pelias/interpolation
interpolation: integration v1

@orangejulius orangejulius deleted the interpolation branch Nov 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment