示例#1
0
文件: server.py 项目: 4sp1r3/monad
def get_nearest_bus_stop_and_coordinates(address):
    """Get the nearest bus stop to the address and its coordinates"""
    coordinates = string_to_coordinates(address)
    if (coordinates["latitude"] == None or coordinates["longitude"] == None): 
        logging.debug("Problematic address: {0}".format(address))       
        raise ValueError("Could not find the coordinates for the address given.")
    else:
        latitude = coordinates["latitude"]
        longitude = coordinates["longitude"]
        stop = coordinates_to_nearest_stop(longitude, latitude)
        result = {"latitude": latitude, "longitude": longitude, "busStop": stop["name"]}
        return result
示例#2
0
 def getCoordinates(self, address):
     """Uses the Route Generator to search for an address"""
     coordinates = string_to_coordinates(address)
     return coordinates["latitude"], coordinates["longitude"]
示例#3
0
文件: weather.py 项目: 4sp1r3/monad
 def getCoordinates(self, address):
     """Uses the Route Generator to search for an address"""
     coordinates = string_to_coordinates(address)
     return coordinates["latitude"], coordinates["longitude"]