Place

public abstract class Place extends Object
implements Parcelable

Represents a particular physical place.

A Place encapsulates information about a physical location, including its name, address, and any other information we might have about it.

Note: In general, some fields will be inapplicable to certain places, or the information may not exist.

Nested Class Summary

class Place.Builder Builder for Place
enum Place.Field Use the values of Place.Field to specify which place data types to return. 
enum Place.Type Type of a Place. 

Constant Summary

int PRICE_LEVEL_MAX_VALUE The highest price level possible, i.e very expensive.
int PRICE_LEVEL_MIN_VALUE The lowest price level possible.
double RATING_MAX_VALUE The highest rating possible, i.e very good.
double RATING_MIN_VALUE The lowest rating possible, i.e very bad.

Inherited Constant Summary

Public Constructor Summary

Place()

Public Method Summary

static Place.Builder
builder()
Returns a Place.Builder.
abstract String
getAddress()
Returns a human-readable address for this Place.
abstract AddressComponents
getAddressComponents()
Returns the address components for this Place's location.
abstract List<String>
getAttributions()
Returns the attributions that must be shown to the user, if data from the Place is used.
abstract String
getId()
Returns the unique ID of this Place.
abstract LatLng
getLatLng()
Returns the location of this Place.
abstract String
getName()
Returns the name of this Place.
abstract OpeningHours
getOpeningHours()
Returns the OpeningHours of this Place.
abstract String
getPhoneNumber()
Returns the place's phone number in international format.
abstract List<PhotoMetadata>
getPhotoMetadatas()
Returns the metadata for a photo associated with a place.
abstract PlusCode
getPlusCode()
Returns the PlusCode location of this Place.
abstract Integer
getPriceLevel()
Returns the price level for this place on a scale from PRICE_LEVEL_MIN_VALUE to PRICE_LEVEL_MAX_VALUE.
abstract Double
getRating()
Returns the place's rating, from RATING_MIN_VALUE to RATING_MAX_VALUE, based on aggregated user reviews.
abstract List<Place.Type>
getTypes()
Returns a list of place types for this Place.
abstract Integer
getUserRatingsTotal()
Returns the total number of user ratings of this Place.
abstract Integer
getUtcOffsetMinutes()
Returns the number of minutes this place’s current timezone is offset from UTC.
abstract LatLngBounds
getViewport()
Returns a viewport for displaying this Place.
abstract Uri
getWebsiteUri()
Returns the URI of the website of this Place.
Boolean
isOpen()
Calculates if the place is open at the device's current time.
Boolean
isOpen(long utcTimeMillis)
Calculates if the place is open at utcTimeMillis.

Inherited Method Summary

Constants

public static final int PRICE_LEVEL_MAX_VALUE

The highest price level possible, i.e very expensive. See getPriceLevel() for more information.

Constant Value: 4

public static final int PRICE_LEVEL_MIN_VALUE

The lowest price level possible. This denotes that a place is free. See getPriceLevel() for more information.

Constant Value: 0

public static final double RATING_MAX_VALUE

The highest rating possible, i.e very good. See getRating() for more information.

Constant Value: 5.0

public static final double RATING_MIN_VALUE

The lowest rating possible, i.e very bad. See getRating() for more information.

Constant Value: 1.0

Public Constructors

public Place ()

Public Methods

public static Place.Builder builder ()

Returns a Place.Builder.

public abstract String getAddress ()

Returns a human-readable address for this Place. May return null if the address is unknown.

The address is localized according to the locale specified in initialize(android.content.Context, String, java.util.Locale) if set; otherwise it uses the device's locale.

public abstract AddressComponents getAddressComponents ()

Returns the address components for this Place's location.

The address is localized according to the locale specified in initialize(android.content.Context, String, java.util.Locale) if set; otherwise it uses the device's locale.

public abstract List<String> getAttributions ()

Returns the attributions that must be shown to the user, if data from the Place is used.

We recommend placing this information below any other Place data. See Displaying Attributions for more details.

This list should not be modified.

Returns
  • The attributions in HTML format, or null if there are no attributions to display.

public abstract String getId ()

Returns the unique ID of this Place.

This ID can be defined in a FetchPlaceRequest, which may be used in fetchPlace(com.google.android.libraries.places.api.net.FetchPlaceRequest) to look up the same place at a later time. Place ID data is constantly changing, so it is possible for subsequent requests using the same ID to fail (for example, if the place no longer exists in the database). A returned Place may also have a different ID from the ID specified in the request, as there may be multiple IDs for a given place.

public abstract LatLng getLatLng ()

Returns the location of this Place.

The location is not necessarily the center of the Place, or any particular entry or exit point, but some arbitrarily chosen point within the geographic extent of the Place.

public abstract String getName ()

Returns the name of this Place.

The name is localized according to the locale specified in initialize(android.content.Context, String, java.util.Locale) if set; otherwise it uses the device's locale.

public abstract OpeningHours getOpeningHours ()

Returns the OpeningHours of this Place.

public abstract String getPhoneNumber ()

Returns the place's phone number in international format. Returns null if no phone number is known, or the place has no phone number.

International format includes the country code, and is prefixed with the plus (+) sign. For example, the international phone number for Google's Mountain View, USA office is +1 650-253-0000.

public abstract List<PhotoMetadata> getPhotoMetadatas ()

Returns the metadata for a photo associated with a place.

Photos are sourced from a variety of locations, including business owners and photos contributed by Google+ users. In most cases, these photos can be used without attribution, or will have the required attribution included as a part of the image. However, you must call getAttributions() to retrieve any additional attributions required, and display those attributions in your application wherever you display the image. For more information, see the developer's guide.

This list should not be modified.

public abstract PlusCode getPlusCode ()

Returns the PlusCode location of this Place.

The location is not necessarily the center of the Place, or any particular entry or exit point, but some arbitrarily chosen point within the geographic extent of the Place.

public abstract Integer getPriceLevel ()

Returns the price level for this place on a scale from PRICE_LEVEL_MIN_VALUE to PRICE_LEVEL_MAX_VALUE.

If no price level is known, null is returned.

The exact amount indicated by a specific value will vary from region to region, though a value of PRICE_LEVEL_MIN_VALUE always denotes that this place is free.

public abstract Double getRating ()

Returns the place's rating, from RATING_MIN_VALUE to RATING_MAX_VALUE, based on aggregated user reviews.

If no rating is known, null is returned.

public abstract List<Place.Type> getTypes ()

Returns a list of place types for this Place.

The elements of this list are drawn from Place.TYPE_* constants, though one should expect there could be new place types returned that were introduced after an app was published.

This list should not be modified.

public abstract Integer getUserRatingsTotal ()

Returns the total number of user ratings of this Place. Returns null if the number of user ratings is not known.

public abstract Integer getUtcOffsetMinutes ()

Returns the number of minutes this place’s current timezone is offset from UTC.

public abstract LatLngBounds getViewport ()

Returns a viewport for displaying this Place. May return null if the size of the place is not known.

This returns a viewport of a size that is suitable for displaying this Place. For example, a Place representing a store may have a relatively small viewport, while a Place representing a country may have a very large viewport.

public abstract Uri getWebsiteUri ()

Returns the URI of the website of this Place. Returns null if no website is known.

This is the URI of the website maintained by the Place, if available. This link is always for a third-party website not affiliated with the Places API.

public Boolean isOpen ()

Calculates if the place is open at the device's current time.

Returns

public Boolean isOpen (long utcTimeMillis)

Calculates if the place is open at utcTimeMillis.

Parameters
utcTimeMillis the milliseconds from 1970-01-01T00:00:00Z.
Returns

Send feedback about...

Places SDK for Android