public class GeocodingRequest extends Object implements GetRequest<String,GeocodingResponse>
GeocodingRequest uses the ESRI webservice to request a coordinate candidates for one or more addresses.
Multiple requests can be executed with one GeocodingRequest object.| Modifier and Type | Class and Description |
|---|---|
static class |
GeocodingRequest.Option
Special Geocoding request options that can be set at creation of the request.
|
| Constructor and Description |
|---|
GeocodingRequest(javax.ws.rs.client.Client client)
Creation of a default geo coding request.
|
GeocodingRequest(javax.ws.rs.client.Client client,
Map<GeocodingRequest.Option,String> extraOptions)
Use a custom client implementation for the geo coding request with non-default request parameters.
|
| Modifier and Type | Method and Description |
|---|---|
GeocodingResponse |
get(Address address)
Invokes a simple request to geocode one address.
|
GeocodingResponse |
get(String singleLineAddress)
Invokes a simple request to geocode one address.
|
GeocodingResponse[] |
getBatchParallel(int parallelThreads,
int triesBeforeFail,
Address... addresses)
Facilitating a parallel batch request for geocoding multiple
Addresses. |
GeocodingResponse[] |
getBatchParallel(int parallelThreads,
int triesBeforeFail,
String... addresses)
Facilitating a parallel batch request for geocoding multiple addresses given as single String.
|
GeocodingResponse[] |
getBatchSequential(Address... addresses)
Facilitating a sequential batch request for geocoding multiple
Addresses. |
GeocodingResponse[] |
getBatchSequential(String... addresses)
Facilitating a sequential batch request for geocoding multiple addresses each given as single String.
|
public GeocodingRequest(javax.ws.rs.client.Client client)
client - specified Client implementation to be used, e.g. Jersey or jBoss clientpublic GeocodingRequest(javax.ws.rs.client.Client client,
Map<GeocodingRequest.Option,String> extraOptions)
client - specified Client implementation to be used, e.g. Jersey or jBoss clientextraOptions - see GeocodingRequest.Option for possibilities - null pointer and empty strings will be ignoredpublic GeocodingResponse get(String singleLineAddress) throws Route360ClientException
String.get in interface GetRequest<String,GeocodingResponse>singleLineAddress - e.g. "Chausseestr. 101, 10115 Berlin"Route360ClientException - when error occurs during requestpublic GeocodingResponse get(Address address) throws Route360ClientException
Address.
Empty or null fields will be ignored by the request.address - e.g. new Address("Chausseestr. 101","","Berlin","10115",null);Route360ClientException - when error occurs during requestpublic GeocodingResponse[] getBatchParallel(int parallelThreads, int triesBeforeFail, String... addresses) throws Route360ClientException
ExecutorService with a specified thread pool size. These threads are used to request single geocoding
results in parallel. Due to temporal unavailability of the service the request may be repeated a number
of times before failing.parallelThreads - greater than or equal to 1 (==1 means sequential processing) - be careful to not create too many ThreadstriesBeforeFail - greater than or equal to 1addresses - not null and with at least on elementRoute360ClientException - when error occurs during requestget(String)public GeocodingResponse[] getBatchParallel(int parallelThreads, int triesBeforeFail, Address... addresses) throws Route360ClientException
Addresses. It uses an
ExecutorService with a specified thread pool size. These threads are used to request single geocoding
results in parallel. Due to temporal unavailability of the service the request may be repeated a number
of times before failing.parallelThreads - greater than or equal to 1 (==1 means sequential processing) - be careful to not create too many ThreadstriesBeforeFail - greater than or equal to 1addresses - not null and with at least on elementRoute360ClientException - when error occurs during requestget(Address)public GeocodingResponse[] getBatchSequential(String... addresses) throws Route360ClientException
addresses - not null and with at least on elementRoute360ClientException - when error occurs during requestget(String)public GeocodingResponse[] getBatchSequential(Address... addresses) throws Route360ClientException
Addresses.addresses - not null and with at least on elementRoute360ClientException - when error occurs during requestget(Address)Copyright © 2017. All rights reserved.