-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial draft of batch geocoding #1046
Conversation
* Adds new `Geocoder.batch` method which takes an array of input text and uses the provider's batch API to make a single HTTP request to geocode all the inputs. * Updates readme with a usage example.
for #1044 |
I've started a draft of how this might work. I'd appreciate a quick review before I go any farther with it. I want to make sure I'm not missing any assumptions. I've only added batch support to the Esri provider, since I'm not sure if other providers have a batch API. The Esri service requires authentication in order to use the batch API, so if you want to run it yourself you'll need to register for a developer account at https://developers.arcgis.com |
since the Esri batch geocoder can generate requests that are potentially very large, it's better to set the request method to POST for those. this adds a configuration option so GET/POST can be used on any provider.
It looks good so far! :) Could more of the functionality for batch be handled in the base lookup? |
I actually like the separation of batch and single requests. In fact, I wonder whether we shouldn't go a step further and use entirely separate lookups for batch requests. Reasons include: (1) combining them is potentially misleading, since only one lookup has batch capability, (2) single and batch queries are used in totally different settings, and (3) there's no reason to expect future batch APIs to be as similar to their single-query counterparts as ESRI's are. Conversely to (3), they could be even more similar than ESRI's, so that argument works both ways. The lack of a second batch API is what causes the confusion in (3) and makes this whole thing a little difficult to think about. I want to choose an architecture here that minimizes the chances of difficult integrations in the future. We should really look at how other batch APIs are implemented. I believe Bing and Mapquest provided batch lookups at one time but I'm not sure whether they still do. As for the code, I have the following thoughts:
|
any updates on this PR? I am currently working on a project which is using sensis service, I am trying to implement a PR about sensis support, which will use the 'post' http request. |
Closing this due to lack of activity, and the fact that creating a unified interface for bulk geocoding is quite difficult given the wide range of services offered (see comment above). |
Geocoder.batch
method which takes an array of input text and uses the provider's batch API to make a single HTTP request to geocode all the inputs.