Skip to content
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

Batch geocoding support #267

Merged
merged 7 commits into from
Jan 11, 2017
Merged

Batch geocoding support #267

merged 7 commits into from
Jan 11, 2017

Conversation

zugaldia
Copy link
Member

We add a new API specific for batch requests that can be used like:

MapboxGeocoding client = new MapboxGeocoding.Builder()
  .setAccessToken(ACCESS_TOKEN)
  .setMode(GeocodingCriteria.MODE_PLACES_PERMANENT)
  .setLocation("20001;20009;22209")
  .build();
Response<List<GeocodingResponse>> response = client.executeBatchCall();

Fixes #262.

Review: @cammace

@mention-bot
Copy link

@zugaldia, thanks for your PR! By analyzing the history of the files in this pull request, we identified @cammace, @ivovandongen and @tobrun to be potential reviewers.

@@ -80,6 +82,10 @@ public GeocodingService getService() {
return call;
}

if (builder.getQuery().contains(";")) {
throw new IllegalArgumentException("Use getBatchCall() for batch calls.");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

niceee

* Used internally.
*
* @return batch call
* @since 1.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@since 2.0.0 :)

*
* @return The Geocoding v5 response
* @throws IOException Signals that an I/O exception of some sort has occurred.
* @since 1.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@since 2.0.0

* @param bbox Optionally pass in a bounding box to limit results in.
* @param limit Optionally pass in a limit the amount of returning results.
* @return A retrofit Call object
* @since 1.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@since 2.0.0

* Execute the batch call
*
* @param callback A Retrofit callback.
* @since 1.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@since 2.0.0

@@ -129,6 +187,15 @@ public void cancelCall() {
}

/**
* Cancel the batch call
*
* @since 1.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@since 2.0.0

* clone the batch call
*
* @return cloned call
* @since 1.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@since 2.0.0

import static org.junit.Assert.assertEquals;

/**
* Created by antonio on 1/10/17.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cough cough :)

@zugaldia
Copy link
Member Author

@cammace Changes addressed, care to 👀 again?

@zugaldia zugaldia merged commit 5a3f31c into master Jan 11, 2017
@zugaldia zugaldia deleted the batch-geocoder branch January 11, 2017 19:01
@zugaldia zugaldia mentioned this pull request Feb 10, 2017
9 tasks
@zugaldia zugaldia mentioned this pull request Feb 22, 2017
9 tasks
@zugaldia zugaldia mentioned this pull request Mar 9, 2017
9 tasks
@zugaldia zugaldia mentioned this pull request Mar 17, 2017
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants