Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions googlemaps/directions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def directions(client, origin, destination,
transit_routing_preference=None, traffic_model=None):
"""Get directions between an origin point and a destination point.

Calls the Directions API. See
https://developers.google.com/maps/documentation/directions for more info.

:param origin: The address or latitude/longitude value from which you wish
to calculate directions.
:type origin: string, dict, list, or tuple
Expand Down
6 changes: 5 additions & 1 deletion googlemaps/distance_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def distance_matrix(client, origins, destinations,
mode=None, language=None, avoid=None, units=None,
departure_time=None, arrival_time=None, transit_mode=None,
transit_routing_preference=None, traffic_model=None, region=None):
""" Gets travel distance and time for a matrix of origins and destinations.
"""Gets travel distance and time for a matrix of origins and destinations.

Calls the Distance Matrix API. See
https://developers.google.com/maps/documentation/distance-matrix for more
info.

:param origins: One or more addresses, Place IDs, and/or latitude/longitude
values, from which to calculate distance and time. Each Place ID string
Expand Down
8 changes: 7 additions & 1 deletion googlemaps/elevation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ def elevation(client, locations):
"""
Provides elevation data for locations provided on the surface of the
earth, including depth locations on the ocean floor (which return negative
values)
values).

Calls the Elevation API. See
https://developers.google.com/maps/documentation/elevation for more info.

:param locations: List of latitude/longitude values from which you wish
to calculate elevation data.
Expand All @@ -41,6 +44,9 @@ def elevation_along_path(client, path, samples):
"""
Provides elevation data sampled along a path on the surface of the earth.

Calls the Elevation API. See
https://developers.google.com/maps/documentation/elevation for more info.

:param path: An encoded polyline string, or a list of latitude/longitude
values from which you wish to calculate elevation data.
:type path: string, dict, list, or tuple
Expand Down
7 changes: 7 additions & 0 deletions googlemaps/geocoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def geocode(client, address=None, place_id=None, components=None, bounds=None, r
coordinates (like latitude 37.423021 and longitude -122.083739), which you
can use to place markers or position the map.

Calls the Geocoding API. See
https://developers.google.com/maps/documentation/geocoding for more info.

:param address: The address to geocode.
:type address: string

Expand Down Expand Up @@ -83,6 +86,10 @@ def reverse_geocode(client, latlng, result_type=None, location_type=None,
Reverse geocoding is the process of converting geographic coordinates into a
human-readable address.

Calls the Geocoding API (Reverse Geocoding). See
https://developers.google.com/maps/documentation/geocoding/requests-reverse-geocoding
for more info.

:param latlng: The latitude/longitude value or place_id for which you wish
to obtain the closest, human-readable address.
:type latlng: string, dict, list, or tuple
Expand Down
28 changes: 28 additions & 0 deletions googlemaps/places.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ def find_place(
The text input can be any kind of Places data, for example,
a name, address, or phone number.

Calls the Places API Find Place (``findplacefromtext``). See
https://developers.google.com/maps/documentation/places/web-service/search-find-place
for more info.

:param input: The text input specifying which place to search for (for
example, a name, address, or phone number).
:type input: string
Expand Down Expand Up @@ -211,6 +215,10 @@ def places(
"""
Places search.

Calls the Places API Text Search (``textsearch``). See
https://developers.google.com/maps/documentation/places/web-service/search-text
for more info.

:param query: The text string on which to search, for example: "restaurant".
:type query: string

Expand Down Expand Up @@ -289,6 +297,10 @@ def places_nearby(
"""
Performs nearby search for places.

Calls the Places API Nearby Search (``nearbysearch``). See
https://developers.google.com/maps/documentation/places/web-service/search-nearby
for more info.

:param location: The latitude/longitude value for which you wish to obtain the
closest, human-readable address.
:type location: string, dict, list, or tuple
Expand Down Expand Up @@ -437,6 +449,10 @@ def place(
"""
Comprehensive details for an individual place.

Calls the Places API Place Details (``details``). See
https://developers.google.com/maps/documentation/places/web-service/details
for more info.

:param place_id: A textual identifier that uniquely identifies a place,
returned from a Places search.
:type place_id: string
Expand Down Expand Up @@ -500,6 +516,10 @@ def places_photo(client, photo_reference, max_width=None, max_height=None):
"""
Downloads a photo from the Places API.

Calls the Places API Place Photos (``photo``). See
https://developers.google.com/maps/documentation/places/web-service/photos
for more info.

:param photo_reference: A string identifier that uniquely identifies a
photo, as provided by either a Places search or Places detail request.
:type photo_reference: string
Expand Down Expand Up @@ -561,6 +581,10 @@ def places_autocomplete(
Returns Place predictions given a textual search string and optional
geographic bounds.

Calls the Places API Place Autocomplete (``autocomplete``). See
https://developers.google.com/maps/documentation/places/web-service/autocomplete
for more info.

:param input_text: The text string on which to search.
:type input_text: string

Expand Down Expand Up @@ -630,6 +654,10 @@ def places_autocomplete_query(
Returns Place predictions given a textual search query, such as
"pizza near New York", and optional geographic bounds.

Calls the Places API Query Autocomplete (``queryautocomplete``). See
https://developers.google.com/maps/documentation/places/web-service/query
for more info.

:param input_text: The text query on which to search.
:type input_text: string

Expand Down
15 changes: 15 additions & 0 deletions googlemaps/roads.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def snap_to_roads(client, path, interpolate=False):
set of data with the points snapped to the most likely roads the vehicle
was traveling along.

Calls the Roads API Snap to Roads (``snapToRoads``). See
https://developers.google.com/maps/documentation/roads/snap for more info.

:param path: The path to be snapped.
:type path: a single location, or a list of locations, where a
location is a string, dict, list, or tuple
Expand Down Expand Up @@ -62,6 +65,10 @@ def nearest_roads(client, points):
segment for each point. The points passed do not need to be part of a
continuous path.

Calls the Roads API Nearest Roads (``nearestRoads``). See
https://developers.google.com/maps/documentation/roads/nearest for more
info.

:param points: The points for which the nearest road segments are to be
located.
:type points: a single location, or a list of locations, where a
Expand All @@ -80,6 +87,10 @@ def nearest_roads(client, points):
def speed_limits(client, place_ids):
"""Returns the posted speed limit (in km/h) for given road segments.

Calls the Roads API Speed Limits (``speedLimits``). See
https://developers.google.com/maps/documentation/roads/speed-limits for
more info.

:param place_ids: The Place ID of the road segment. Place IDs are returned
by the snap_to_roads function. You can pass up to 100 Place IDs.
:type place_ids: str or list
Expand All @@ -101,6 +112,10 @@ def snapped_speed_limits(client, path):
The provided points will first be snapped to the most likely roads the
vehicle was traveling along.

Calls the Roads API Speed Limits (``speedLimits``). See
https://developers.google.com/maps/documentation/roads/speed-limits for
more info.

:param path: The path of points to be snapped.
:type path: a single location, or a list of locations, where a
location is a string, dict, list, or tuple
Expand Down
3 changes: 3 additions & 0 deletions googlemaps/timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def timezone(client, location, timestamp=None, language=None):
"""Get time zone for a location on the earth, as well as that location's
time offset from UTC.

Calls the Time Zone API. See
https://developers.google.com/maps/documentation/timezone for more info.

:param location: The latitude/longitude value representing the location to
look up.
:type location: string, dict, list, or tuple
Expand Down