Hi all,

I wanted to open this issue to solicit feedback on how we should deal with multiple-responses from a geocoding API. Many address based APIs will return a set of multiple addresses that all represent candidate locations, ordered by likelihood.

Right now we are simply tossing all the responses except for the first one. We stuff the $geom->data array with the raw response so downstream users can make use of it if they need to.

I would like to see if we can deal with this in a more elegant way.

Comments

phayes’s picture

My proposal is as follows:

1. doing a bare-bones call against the geocoder API will return a MultiPoint feature with all the candidate points, with likelihood ordering preserved.
2. geocoder widget should provide an option on what to do, with the default being keeping the first candidate and tossing the rest.

Sadly this would be an API breaking change, so we would have to start a 2.x branch. :-(

zzolo’s picture

Why not just add an argument to the geocoder call that would return all the results, and the implementer can decide on what to do from there?

simon georges’s picture

Google geocoder already has a "multiple" handling option (following zzolo's proposal, it seems), so this could be implemented for others as well, I suppose.

simon georges’s picture

Category: task » feature

Re-qualifying as feature request.

simon georges’s picture

Issue summary: View changes

adding more desc

pol’s picture

Issue summary: View changes
Status: Active » Closed (outdated)