- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Real batch geocoding for TomTom #325
Conversation
Fixing fetch adapter for non-json responses
Fix Here geocoding ApplicationError handling
@nchaulet I'm sure that looking into this it isn't among your top priorities, I'm wondering if you have had a chance to look at this because I'm planning to add this very same support for Here sooner than later and these changes depend on this PR. Thanks! |
Hi @charly22 I took a first look at this and it looks good to me, I still want to run it locally too, I have one suggestion that I would love you to address. |
@@ -61,21 +61,32 @@ Geocoder.prototype.reverse = function(query, callback) { | |||
* @return promise | |||
*/ | |||
Geocoder.prototype.batchGeocode = function(values, callback) { | |||
return BPromise.resolve(values) | |||
return BPromise.resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will make sense to move that part to the abstract geocoder and to rely on the existence of _batchGeocoder
instead of relying on throwing an error to have a fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does make sense, in fact, it was my first approach but I can't remember why I've fallen back to this way. I'll give it another try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look goods to me 🚀 going to do some more manual test but hopefully I will publish a new version with that change this week
What does this PR do?
Changes the strategy used to geocoding in batch using async batch TomTom API
Brief of changes
AbstractGeocoder
calls_batchGeocode
of the provider who has this implemented or throws an error if it doesn't.Geocoder
callbatchGeocode
catching thenot implemented
error to fallback to the pool-of-promises legacy strategyTomTomGeocoder
implements_batchGeocode
calling the TomTom Batch APIs to 1. Create a job, 2. Poll the job status 3. Download the results when it's donelimit
andcountry
parameters forTomTom
(see TODOs)Additionally
FetchAdapter
to allow the return of the full response in order to check status codes, batch API it's not as simple as getting JSON results,POST
support toFetchAdaptar
(I haven't done for the rest of the adapter, but I believe they're deprecated, I'm I right)querystring
deprecated dependency onFetchAdapter
TODOs
README.md
with new TomTom parameters @nchaulet I'd appreciate your help here. Thanks :)