public class GeoTemplate extends Object implements GeoOperations
Constructor and Description |
---|
GeoTemplate(RestTemplate restTemplate,
boolean isAuthorizedForUser,
boolean isAuthorizedForApp) |
Modifier and Type | Method and Description |
---|---|
protected URI |
buildUri(String path) |
protected URI |
buildUri(String path,
MultiValueMap<String,String> parameters) |
protected URI |
buildUri(String path,
String parameterName,
String parameterValue) |
Place |
createPlace(PlacePrototype placePrototype)
Creates a new place.
|
SimilarPlaces |
findSimilarPlaces(double latitude,
double longitude,
String name)
Finds places similar to a place described in the parameters.
|
SimilarPlaces |
findSimilarPlaces(double latitude,
double longitude,
String name,
String streetAddress,
String containedWithin)
Finds places similar to a place described in the parameters.
|
Place |
getPlace(String placeId)
Retrieves information about a plce
|
protected void |
requireAppAuthorization() |
protected void |
requireEitherUserOrAppAuthorization() |
protected void |
requireUserAuthorization() |
List<Place> |
reverseGeoCode(double latitude,
double longitude)
Retrieves up to 20 places matching the given location.
|
List<Place> |
reverseGeoCode(double latitude,
double longitude,
PlaceType granularity,
String accuracy)
Retrieves up to 20 places matching the given location and criteria
|
List<Place> |
search(double latitude,
double longitude)
Searches for up to 20 places matching the given location.
|
List<Place> |
search(double latitude,
double longitude,
PlaceType granularity,
String accuracy,
String query)
Searches for up to 20 places matching the given location and criteria
|
public GeoTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser, boolean isAuthorizedForApp)
public Place getPlace(String placeId)
GeoOperations
getPlace
in interface GeoOperations
placeId
- the place IDPlace
public List<Place> reverseGeoCode(double latitude, double longitude)
GeoOperations
reverseGeoCode
in interface GeoOperations
latitude
- the latitudelongitude
- the longitudePlace
s that the point is withinpublic List<Place> reverseGeoCode(double latitude, double longitude, PlaceType granularity, String accuracy)
GeoOperations
reverseGeoCode
in interface GeoOperations
latitude
- the latitudelongitude
- the longitudegranularity
- the minimal granularity of the places to return. If null, the default granularity (neighborhood) is assumed.accuracy
- a radius of accuracy around the given point. If given a number, the value is assumed to be in meters. The number may be qualified with "ft" to indicate feet. If null, the default accuracy (0m) is assumed.Place
s that the point is withinpublic List<Place> search(double latitude, double longitude)
GeoOperations
search
in interface GeoOperations
latitude
- the latitudelongitude
- the longitudePlace
s that the point is withinpublic List<Place> search(double latitude, double longitude, PlaceType granularity, String accuracy, String query)
GeoOperations
search
in interface GeoOperations
latitude
- the latitudelongitude
- the longitudegranularity
- the minimal granularity of the places to return. If null, the default granularity (neighborhood) is assumed.accuracy
- a radius of accuracy around the given point. If given a number, the value is assumed to be in meters. The number may be qualified with "ft" to indicate feet. If null, the default accuracy (0m) is assumed.query
- a free form text value to help find places by name. If null, no query will be applied to the search.Place
s that the point is withinpublic SimilarPlaces findSimilarPlaces(double latitude, double longitude, String name)
GeoOperations
findSimilarPlaces
in interface GeoOperations
latitude
- the latitudelongitude
- the longitudename
- the name that the place is known asSimilarPlaces
collection, including a token that can be used to create a new place.public SimilarPlaces findSimilarPlaces(double latitude, double longitude, String name, String streetAddress, String containedWithin)
GeoOperations
findSimilarPlaces
in interface GeoOperations
latitude
- the latitudelongitude
- the longitudename
- the name that the place is known asstreetAddress
- the place's street address. May be null.containedWithin
- the ID of the place that the place is contained withinSimilarPlaces
collection, including a token that can be used to create a new place.public Place createPlace(PlacePrototype placePrototype)
GeoOperations
createPlace
in interface GeoOperations
placePrototype
- the place prototype returned in a SimilarPlaces
from a call to findSimilarPlaces()Place
object with the newly created place dataprotected void requireUserAuthorization()
protected void requireAppAuthorization()
protected void requireEitherUserOrAppAuthorization()
protected URI buildUri(String path, MultiValueMap<String,String> parameters)