def random_route_from(point, experience=None, exclude=()): destination = random_point_near(point, experience=experience, exclude=()) route, = directions(_googlify(point), _googlify(destination))['routes'] return LineString( polyline.decode(route['overview_polyline']['points']), srid=4326, )
def google_it(number, origin, destination): retrive_db(number) print "Google_it called" print "Origin is: "+str(origin)+". Type is "+str(type(origin)) print "Destination is: "+str(destination)+". Type is "+str(type(destination)) step_details = google.directions(origin, destination) #TODO: make function print "step_details is: "+str(step_details)+". Type is "+str(type(step_details)) if step_details == []: send_text.text(number, "Unfourtunatley, we cannot find directions for you. Sorry for any inconvinience caused.") else: for step in step_details: send_text.text(number,step) sessions.delete(number) return
def google_it(mobile, origin, destination, req_time): #print "Google_it called" #print "Origin is: "+str(origin)+". Type is "+str(type(origin)) #print "Destination is: "+str(destination)+". Type is "+str(type(destination)) step_details = google.directions(origin, destination) #TODO: make function #print "step_details is: "+str(step_details)+". Type is "+str(type(step_details)) if step_details == []: send_text.text(mobile, "Unfortunately , we cannot find directions for you. Sorry for any inconvenience caused.") else: i = 1 for step in step_details: send_text.text(mobile, str(i) + ") " + step) i += 1 time.sleep(3) sessions.delete(mobile) return