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
def getCoordinates(self, address): """Uses the Route Generator to search for an address""" coordinates = string_to_coordinates(address) return coordinates["latitude"], coordinates["longitude"]