Class Place
Class Place
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.search.Place
-
public final class Place extends NativeBase
Represents a location object, such as a country, a city, a point of interest (POI) etc.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Placedeserialize(java.lang.String serializedPlace)Returns aPlacecreated from serialized string.java.util.List<GeoCoordinates>getAccessPoints()Gets the access points to the place, such as the points on a road or in a parking lot.AddressgetAddress()Gets the address of the place.AreaTypegetAreaType()Gets the area type.GeoBoxgetBoundingBox()Gets the geographic coordinates of the bounding box containing the place.DetailsgetDetails()Gets the place's detailed information.java.lang.IntegergetDistanceInMeters()Gets the distance from the search center to the place in meters.GeoCoordinatesgetGeoCoordinates()Gets the geographic coordinates of the place.java.lang.StringgetId()Gets the unique id of this resource.PlaceTypegetPlaceType()Gets the place type.java.lang.StringgetPoliticalView()Gets the geopolitical view, defined as a three letter country code, each disputed territory has international and alternative views.java.lang.StringgetTitle()Gets the localized title for the resource.booleanisCoordinatesInterpolated()Gets the flag saying whether the coordinates of the house number were interpolated or not.java.lang.StringserializeCompact()SerializesPlaceto persist or transfer.
-
-
-
Method Detail
-
serializeCompact
@NonNull public java.lang.String serializeCompact()
Serializes
Placeto persist or transfer. Preserves limited amount of data:- Returns:
The serialized place
-
deserialize
@NonNull public static Place deserialize(@NonNull java.lang.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
@NonNull public java.lang.String getTitle()
Gets the localized title for the resource.
- Returns:
The localized title for the resource.
-
getId
@NonNull public java.lang.String 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
@NonNull public PlaceType getPlaceType()
Gets the place type.
- Returns:
The place type.
-
getAreaType
@Nullable public AreaType 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
@NonNull public Address 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
@NonNull public Details getDetails()
Gets the place's detailed information.
- Returns:
The place's detailed information.
-
getGeoCoordinates
@Nullable public GeoCoordinates 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
@NonNull public java.util.List<GeoCoordinates> 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
@Nullable public GeoBox 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
@Nullable public java.lang.Integer 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
@Nullable public java.lang.String 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.
-
-