bing_map

Module Contents

Classes

BINGMap

BING Map plugin for looking up map information

class lagent.actions.bing_map.BINGMap(key=None, description=None, parser=JsonParser, enable=True)

Bases: lagent.actions.base_action.BaseAction

BING Map plugin for looking up map information

Parameters:
get_distance(start, end)

Get the distance between two locations in km.

Parameters:
  • start (str) – The start location

  • end (str) – The end location

Returns:

distance information
  • distance (str): the distance in km.

Return type:

dict

get_route(start, end)

Get the route between two locations in km.

Parameters:
  • start (str) – The start location

  • end (str) – The end location

Returns:

route information
  • route (list): the route, a list of actions.

Return type:

dict

get_coordinates(location)

Get the coordinates of a location.

Parameters:

location (str) – the location need to get coordinates.

Returns:

coordinates information
  • latitude (float): the latitude of the location.

  • longitude (float): the longitude of the location.

Return type:

dict

search_nearby(search_term, places='unknown', latitude=0.0, longitude=0.0, radius=5000)

Search for places nearby a location, within a given radius, and return the results into a list. You can use either the places name or the latitude and longitude.

Parameters:
  • search_term (str) – the place name.

  • places (str) – the name of the location. Defaults to 'unknown'.

  • latitude (float) – the latitude of the location. Defaults to 0.0.

  • longitude (float) – the longitude of the location. Defaults to 0.0.

  • radius (int) – radius in meters. Defaults to 5000.

Returns:

places information
  • places (list): the list of places, each place is a dict with name and address, at most 5 places.

Return type:

dict