Types for Google Maps Geocode v4 API¶
- class google.maps.geocode_v4.types.Destination(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageA destination. This includes the primary place, related places, entrances, and navigation points.
- primary¶
The primary place identified by the
primary_queryin the request.
- containing_places¶
The less precise places that the primary place is contained by. For example, the apartment complex that contains this building.
- Type
MutableSequence[google.maps.geocode_v4.types.PlaceView]
- sub_destinations¶
More precise sub-destinations of the primary place. For example, units contained in a building.
Note: compared to the SubDestination returned by the Places API, this list of sub-destinations is more exhaustive, and each sub-destination contains more information.
- Type
MutableSequence[google.maps.geocode_v4.types.PlaceView]
- landmarks¶
Landmarks that can be used to communicate where the destination is or help with arrival.
- Type
MutableSequence[google.maps.geocode_v4.types.Landmark]
- entrances¶
Entrances for this destination.
- Type
MutableSequence[google.maps.geocode_v4.types.Entrance]
Navigation points for this destination.
- Type
MutableSequence[google.maps.geocode_v4.types.NavigationPoint]
- class google.maps.geocode_v4.types.Entrance(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageAn entrance is a single latitude/longitude coordinate pair that defines the location of an entry and exit point for a place.
- location¶
The location of the entrance.
- Type
google.type.latlng_pb2.LatLng
- tags¶
A list of tags that describe the entrance.
- Type
MutableSequence[google.maps.geocode_v4.types.Entrance.Tag]
- class Tag(value)[source]¶
Bases:
proto.enums.EnumCharacteristics that describe an entrance.
- Values:
- TAG_UNSPECIFIED (0):
Not used.
- PREFERRED (1):
The entrance likely provides physical access to the primary place in the returned destination. A place can have multiple preferred entrances. If an entrance does not have this tag, it means the entrance is physically on the same building as the primary place, but does not necessarily provide access to the place.
For example, if the primary place is a restaurant in a strip mall, the “PREFERRED” entrances will be the ones that likely lead into the restaurant itself, while the other returned entrances will be other entrances for the building, such as entrances into other restaurants in the strip mall.
If the primary place is a building itself, the
PREFERREDentrances will be the ones that lead into the “main” part of the building. For example, in a shopping center thePREFERREDentrances will be the ones that allow access to the main foyer area, but if an entrance only provides access to a store on the side of the building, it won’t be aPREFERREDentrance.Note: a
PREFERREDentrance might not provide access to the primary place, and a non-PREFERREDentrance might provide access to the primary place.
- class google.maps.geocode_v4.types.GeocodeAddressRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageRequest message for GeocodeService.GeocodeAddress.
This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.
- address_query¶
The unstructured address to geocode.
This field is a member of oneof
address_input.- Type
- address¶
The structured address to geocode in postal address format.
This field is a member of oneof
address_input.- Type
google.type.postal_address_pb2.PostalAddress
- location_bias¶
Optional. The region to search. This location serves as a bias which means results around the given location are preferred.
- region_code¶
Optional. Region code. The region code, specified as a ccTLD (“top-level domain”) two-character value. The parameter affects results based on applicable law. This parameter will also influence, but not fully restrict, results from the service.
- Type
- class LocationBias(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe region to search. This location serves as a bias which means results around the given location are preferred.
- rectangle¶
A rectangular box defined by northeast and southwest corner.
rectangle.high()must be the northeast point of the rectangle viewport.rectangle.low()must be the southwest point of the rectangle viewport.rectangle.low().latitude()cannot be greater thanrectangle.high().latitude(). This will result in an empty latitude range. A rectangle viewport cannot be wider than 180 degrees.This field is a member of oneof
type.- Type
google.geo.type.types.Viewport
- class google.maps.geocode_v4.types.GeocodeAddressResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageResponse message for [GeocodeService.GeocodeAddress][google.maps.geocode.v4.GeocodeService.GeocodeAddress].
- results¶
The geocoding result.
- Type
MutableSequence[google.maps.geocode_v4.types.GeocodeResult]
- class google.maps.geocode_v4.types.GeocodeLocationRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageRequest message for GeocodeService.GeocodeLocation.
This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.
- location_query¶
The location in the format of “lat,lng” string. For example, “64.7611872,-18.4705364”.
This field is a member of oneof
location_input.- Type
- location¶
The location in the structured format.
This field is a member of oneof
location_input.- Type
google.type.latlng_pb2.LatLng
- region_code¶
Optional. Region code. The region code, specified as a ccTLD (“top-level domain”) two-character value. The parameter affects results based on applicable law.
- Type
- types¶
Optional. A set of type tags to restrict the results. Results that do not have any of the specified types are removed.
For the complete list of possible values, see Table A and Table B at https://developers.google.com/maps/documentation/places/web-service/place-types.
- Type
MutableSequence[str]
- granularity¶
Optional. A filter of one or more location granularity enums.
- Type
MutableSequence[google.maps.geocode_v4.types.GeocodeResult.Granularity]
- class google.maps.geocode_v4.types.GeocodeLocationResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageResponse message for [GeocodeService.GeocodeLocation][google.maps.geocode.v4.GeocodeService.GeocodeLocation].
- results¶
The geocoding result.
- Type
MutableSequence[google.maps.geocode_v4.types.GeocodeResult]
- plus_code¶
Plus code of the location in the request.
- class google.maps.geocode_v4.types.GeocodePlaceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageRequest message for GeocodeService.GeocodePlace.
- class google.maps.geocode_v4.types.GeocodeResult(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageA geocode result contains geographic information about a place.
- place¶
This Place’s resource name, in
places/{placeId}format. Can be used to look up the Place.- Type
- location¶
The latlng of this address.
- Type
google.type.latlng_pb2.LatLng
- granularity¶
The granularity of the location.
- viewport¶
A viewport suitable for displaying the geocode result.
- Type
google.geo.type.types.Viewport
- bounds¶
A bounding box for the address.
- Type
google.geo.type.types.Viewport
- postal_address¶
The address in postal address format.
- Type
google.type.postal_address_pb2.PostalAddress
- address_components¶
Repeated components for each locality level.
- Type
MutableSequence[google.maps.geocode_v4.types.GeocodeResult.AddressComponent]
- postal_code_localities¶
Complete list of localities contained in the postal code.
This is only populated when the result is of type “postal_code”.
- Type
MutableSequence[google.type.localized_text_pb2.LocalizedText]
- types¶
A set of type tags for this result. For example, “political” and “administrative_area”.
For the complete list of possible values, see Table A and Table B at https://developers.google.com/maps/documentation/places/web-service/place-types.
- Type
MutableSequence[str]
- plus_code¶
Plus code of the location in this geocode.
- class AddressComponent(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe structured components that form the formatted address, if this information is available.
- long_text¶
The full text description or name of the address component. For example, an address component for the country Australia may have a long name of “Australia”.
- Type
- short_text¶
An abbreviated textual name for the address component, if available. For example, an address component for the country of Australia may have a short name of “AU”.
- Type
- types¶
An array indicating the type(s) of the address component. See https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types for more details.
- Type
MutableSequence[str]
- class Granularity(value)[source]¶
Bases:
proto.enums.EnumThe granularity of the location.
- Values:
- GRANULARITY_UNSPECIFIED (0):
Do not use.
- ROOFTOP (1):
The non-interpolated location of an actual plot of land corresponding to the matched address.
- RANGE_INTERPOLATED (2):
Interpolated from a range of street numbers. For example, if we know that a segment of Amphitheatre Pkwy contains numbers 1600 - 1699, then 1650 might be placed halfway between its endpoints.
- GEOMETRIC_CENTER (3):
The geometric center of a feature for which we have polygonal data.
- APPROXIMATE (4):
Everything else.
- class google.maps.geocode_v4.types.Landmark(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageLandmarks are used to communicate where the destination is or help with arriving at the destination.
- relational_description¶
A human-readable description of how the destination relates to the landmark. For example: “Near the Empire State Building” or “Across from the White House”.
- Type
google.type.localized_text_pb2.LocalizedText
- tags¶
Tags that describe how the landmark can be used in the context of the destination.
- Type
MutableSequence[google.maps.geocode_v4.types.Landmark.Tag]
- straight_line_distance_meters¶
Output only. The straight-line distance from this landmark to the destination in meters.
- Type
- travel_distance_meters¶
Output only. The road-network distance from this landmark to the destination in meters.
- Type
- class Tag(value)[source]¶
Bases:
proto.enums.EnumThe list of all possible tags that describe how a landmark can be used in the context of a destination.
If an address has both the
ADDRESSandARRIVALtags, it means the landmark is both locally prominent and close to the destination.- Values:
- TAG_UNSPECIFIED (0):
Not used.
- ADDRESS (1):
A locally prominent place that can be used to identify the general location of the destination. Typically within a few hundred meters of the destination. These are similar to the landmarks returned by the Address Descriptors feature of the Geocoding API:
- ARRIVAL (2):
A place that can be used to help arrive at the destination. Useful for navigation once you are close to the destination. For example, this landmark might be a place that is across the street from the destination. A landmark with this tag is typically closer to the destination than landmarks with the
ADDRESStag.
Bases:
proto.message.MessageA navigation point is a location next to a road where navigation can end.
Output only. A token that can be used to identify this navigation point.
- Type
The display name of this navigation point. For example, “5th Ave” or “Gate B”.
- Type
google.type.localized_text_pb2.LocalizedText
A point next to the road segment where navigation should end. The point is intentionally slightly offset from the road’s centerline to clearly mark the side of the road where the place is located.
- Type
google.type.latlng_pb2.LatLng
Travel modes that are appropriate for this navigation point.
- Type
MutableSequence[google.maps.geocode_v4.types.NavigationPoint.TravelMode]
Lists
usagessupported by this navigation point. If empty, it does not necessarily mean its usage is restricted in any way. All navigation points can be used for general navigation.- Type
MutableSequence[google.maps.geocode_v4.types.NavigationPoint.Usage]
Bases:
proto.enums.EnumTravel modes that are appropriate for this navigation point.
- Values:
- TRAVEL_MODE_UNSPECIFIED (0):
Not used.
- DRIVE (1):
Suitable for driving.
- WALK (2):
Suitable for walking.
Bases:
proto.enums.EnumUsages supported by this navigation point. New values may be added in the future.
- Values:
- USAGE_UNSPECIFIED (0):
Not used.
- UNKNOWN (1):
Indicates that the usage type is unknown.
- DROPOFF (2):
Suitable for dropping off a passenger. For example, a rideshare drop off location.
- PICKUP (3):
Suitable for picking up a passenger. For example, a rideshare pick up location.
- PARKING (4):
Suitable for parking. For example, within a parking lot.
- class google.maps.geocode_v4.types.PlaceView(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageRepresents a view of a Place in the Places API. It also provides additional information specific to destinations, such as the structure type and the display polygon.
In some cases, a
PlaceViewwith the same place ID might differ from what is being returned by the Places API for thetypesanddisplay_namefields.- place¶
This Place’s resource name, in
places/{placeId}format. Can be used to look up the Place.- Type
- display_name¶
Human readable place description. For example, “Gate B”, “McDonalds”.
- Type
google.type.localized_text_pb2.LocalizedText
- primary_type¶
The primary place type of this place. See https://developers.google.com/maps/documentation/places/web-service/place-types for the list of possible values.
Note: This field is not always populated. Be prepared to use the
typesfield in such situations.- Type
- types¶
All associated place types of this place. See https://developers.google.com/maps/documentation/places/web-service/place-types for the list of possible values.
- Type
MutableSequence[str]
- postal_address¶
Structured address.
- Type
google.type.postal_address_pb2.PostalAddress
- structure_type¶
The type of structure corresponding to this place.
- location¶
The location of this place. For places with display polygons, this can represent a good spot to put a marker on the map.
- Type
google.type.latlng_pb2.LatLng
- display_polygon¶
The polygon outline of the place in GeoJSON format, using the RFC 7946 format: https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6.
Note: The RFC 7946 format supports MultiPolygons, so one
display_polygonobject can represent multiple polygons.
- class StructureType(value)[source]¶
Bases:
proto.enums.EnumThe type of structure that this place represents.
- Values:
- STRUCTURE_TYPE_UNSPECIFIED (0):
Not used.
- POINT (1):
A point location.
- SECTION (2):
A sub-section of a building.
- BUILDING (3):
A building.
- GROUNDS (4):
A large area that typically contains multiple buildings, such as a university campus, an apartment complex, or a shopping mall.
- class google.maps.geocode_v4.types.PlusCode(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessagePlus code (http://plus.codes) is a location reference with two formats: global code defining a 14mx14m (1/8000th of a degree) or smaller rectangle, and compound code, replacing the prefix with a reference location.
- global_code¶
Place’s global (full) code, such as “9FWM33GV+HQ”, representing an 1/8000 by 1/8000 degree area (~14 by 14 meters).
- Type
- class google.maps.geocode_v4.types.SearchDestinationsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageRequest message for DestinationService.SearchDestinations.
This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.
- place¶
The resource name of a place, in
places/{place_id}format.This field is a member of oneof
primary_query.- Type
- travel_modes¶
Optional. The travel modes to filter navigation points for. This influences the
navigation_pointsfield returned in the response. If empty, navigation points of all travel modes are returned.- Type
MutableSequence[google.maps.geocode_v4.types.NavigationPoint.TravelMode]
- region_code¶
Optional. Region code. The region code, specified as a ccTLD (“top-level domain”) two-character value. The parameter affects results based on applicable law. This parameter also influences, but not fully restricts, results from the service.
- Type
- class AddressQuery(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageThe street address that you want to search for. Specify addresses in accordance with the format used by the national postal service of the country concerned.
This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.
- class LocationQuery(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageA location query to identify a nearby primary destination.
Note: if the location query is within a building that contains subpremises, it is possible that the returned primary place is a subpremise. In these cases, the
containing_placesfield will include the building.- location¶
A precise LatLng location.
This field is a member of oneof
kind.- Type
google.type.latlng_pb2.LatLng
- place_filter¶
Optional. Filters to apply to destination candidates.
- class PlaceFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageFilters to apply to destination candidates.
- structure_type¶
Optional. If specified, all destinations are guaranteed to have a primary place with this structure type. This can result in filtering out some destinations, or in coarsening/refining the returned destinations.
For example, if
GROUNDSis specified, all returned destinations will have a primary place with theGROUNDSstructure type. This can result in filtering out some destinations that are not part of a grounds, or in coarsening the returned destinations to the grounds level.Another use of this field is to more easily extract building display polygons. For example, if
BUILDINGis specified, the primary place’s display polygon will be for the building at the specified location.
- addressability¶
Optional. If specified, only returns destinations that meet the corresponding addressability criteria.
- class Addressability(value)[source]¶
Bases:
proto.enums.EnumDefines options for addressability filtering. New values may be added in the future.
- Values:
- ADDRESSABILITY_UNSPECIFIED (0):
When unspecified, the service will choose a sensible default.
- ANY (1):
Addressability is not a filtering criteria. Destinations are returned regardless of their addressability.
- PRIMARY (2):
All destinations returned will have a primary place with a street level address or name.
- WEAK (3):
All destinations returned will have either a primary place or a subdestination with a street level address or name.
- class google.maps.geocode_v4.types.SearchDestinationsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.MessageResponse message for DestinationService.SearchDestinations.
- destinations¶
A list of destinations.
The service returns one result if a primary destination can be unambiguously identified from the primary query. Otherwise, the service might return multiple results for disambiguation or zero results.
- Type
MutableSequence[google.maps.geocode_v4.types.Destination]