Googlegeocoding¶
flowtask.interfaces.GoogleGeocoding
¶
GoogleMapsGeocodingClient
¶
Bases: GoogleClient, ABC
Google Maps Geocoding Client for location-based tasks including geocoding, reverse geocoding, distance calculation, and place details.
calculate_distance
async
¶
Calculate the distance between two locations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
origin
|
str
|
Starting location (address or coordinates). |
required |
destination
|
str
|
Ending location (address or coordinates). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict
|
Distance and duration between the origin and destination. |
geocode_address
async
¶
Geocode an address to retrieve latitude and longitude.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
The address to geocode. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict
|
Geocoded location with latitude and longitude. |
get_place_details
async
¶
Get detailed information about a place by its place ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
place_id
|
str
|
The place ID of the location. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict
|
Detailed information about the place. |
reverse_geocode
async
¶
Reverse geocode coordinates to retrieve address information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lat
|
float
|
Latitude of the location. |
required |
lng
|
float
|
Longitude of the location. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
List[Dict]
|
List of addresses for the location. |