Place (API Reference)
Class Place
Represents a location object, such as a country, a city, a point of interest (POI) etc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Placedeserialize(String serializedPlace) Returns aPlacecreated from serialized string.Gets the access points to the place, such as the points on a road or in a parking lot.Gets the address of the place.Gets the area type.Gets the geographic coordinates of the bounding box containing the place.Gets the place's detailed information.Gets the distance from the search center to the place in meters.Gets the geographic coordinates of the place.getId()Gets the unique id of this resource.Gets the place type.Gets the geopolitical view, defined as a three letter country code, each disputed territory has international and alternative views.getTitle()Gets the localized title for the resource.booleanGets the flag saying whether the coordinates of the house number were interpolated or not.SerializesPlaceto persist or transfer.
-
Method Details
-
serializeCompact
Serializes
Placeto persist or transfer. Preserves limited amount of data:- Returns:
The serialized place
-
deserialize
@NonNull public static Place deserialize(@NonNull String serializedPlace) throws PlaceSerializationException Returns a
Placecreated from serialized string.- Parameters:
serializedPlace-The serialized place
- Returns:
A
Placecreated from serialized string.- Throws:
PlaceSerializationException-Indicates what went wrong during deserialization attempt.
-
getTitle
Gets the localized title for the resource.
- Returns:
The localized title for the resource.
-
getId
Gets the unique id of this resource. It can be used to query further information.
When returned from
OfflineSearchEngine,idis valid only forPlaceobjects whoseplace_typeisPOI. Otherwise, it is empty.- Returns:
The unique id of this resource. It can be used to query further information.
-
getPlaceType
Gets the place type.
- Returns:
The place type.
-
getAreaType
Gets the area type. It is available only when the
getPlaceType()isPlaceType.AREA.- Returns:
The area type. It is available only when the
getPlaceType()isPlaceType.AREA.
-
getAddress
Gets the address of the place.
Note that while
OfflineSearchEngine.suggestandOfflineSearchEngine.suggestByTextset all available details,SearchEngine.suggestandSearchEngine.suggestByTextset onlyAddress.addressText. Complete address details can be obtained by searching withPlaceIdQuery.- Returns:
The address of the place.
Note that while
OfflineSearchEngine.suggestandOfflineSearchEngine.suggestByTextset all available details,SearchEngine.suggestandSearchEngine.suggestByTextset onlyAddress.addressText. Complete address details can be obtained by searching withPlaceIdQuery.
-
getDetails
Gets the place's detailed information.
- Returns:
The place's detailed information.
-
getGeoCoordinates
Gets the geographic coordinates of the place.
Can be
nullwhen retrieved from a suggestion's place property.- Returns:
The geographic coordinates of the place.
-
isCoordinatesInterpolated
public boolean isCoordinatesInterpolated()Gets the flag saying whether the coordinates of the house number were interpolated or not.
This property is valid only for house number results retrieved using online search. When false, it means
getGeoCoordinates()point to an accurate position of the house. Otherwise coordinates are slightly less accurate, but are based on a highly optimized interpolation algorithm.- Returns:
A property that says whether the coordinates of the house number were interpolated or not.
-
getAccessPoints
Gets the access points to the place, such as the points on a road or in a parking lot.
A place can have multiple access points. For example, a large warehouse can have multiple entrances, while the center of the warehouse may not be directly reachable. Note that access points are meant to be reachable by vehicles. For routes it is recommended to navigate to one of the available access points (if any), whereas the
sideOfStreetHintshould be set to the geographic coordinates of the place. The list is empty when no access points are known or when the place is directly reachable. A place can have multiple access points. For example, a large warehouse can have multiple entrances, while the center of the warehouse may not be directly reachable. Note that access points are meant to be reachable by vehicles. For routes it is recommended to navigate to one of the available access points (if any), whereas thesideOfStreetHintshould be set to the geographic coordinates of the place. The list is empty when no access points are known or when the place is directly reachable.- Returns:
The access points to the place, such as the points on a road or in a parking lot.
-
getBoundingBox
Gets the geographic coordinates of the bounding box containing the place.
- Returns:
The geographic coordinates of the map bounding box containing the place.
-
getDistanceInMeters
Gets the distance from the search center to the place in meters.
- Returns:
The distance from the search center to the place in meters.
-
getPoliticalView
Gets the geopolitical view, defined as a three letter country code, each disputed territory has international and alternative views.
Populated when the geopolitical view parameter is set in the
SDKOptionsand passed toSDKNativeEngineon instantiation, but only if it is an alternative view. For more details refer toSDKOptions.- Returns:
The geopolitical view, defined as a three letter country code, each disputed territory has international and alternative views.
-