Uber Nairobi Ambulance Perambulation Challenge
$6,000 USD
Can you use ML to create an optimised ambulance deployment strategy in Nairobi?
683 data scientists enrolled, 206 on the leaderboard
ConstructionTransportationHealthPredictionStructuredLocation
Kenya
17 September—24 January 2021
Ends in 2 months
Road name of each coordinate.
published 7 Nov 2020, 19:30

Hey, I would like to know if any one knows how to find all the road names in the location - Nairobi. The segment geometry data only has road names of a smaller portion of the area. Could there be any way the names of these other roads be found?

#################################### Road information ######################################
  
  def get_address_by_location(latitude, longitude, language="en"):
    """This function returns an address as raw from a location
    will repeat until success"""
    # build coordinates string to pass to reverse() function
    coordinates = f"{latitude}, {longitude}"
    # sleep for a second to respect Usage Policy
    time.sleep(1)
    try:
        return app.reverse(coordinates, language=language).raw
    except:
        return get_address_by_location(latitude, longitude)

def get_road_by_location(latitude, longitude):
  address = get_address_by_location(latitude, longitude)
  return address['address']
  
# launch only one time and save to file. Works 2 hours for collecting info
road_list_for_locations = []
for i in tqdm(range(df.shape[0])):
    road_list_for_locations.append(get_road_by_location(df.latitude[i], df.longitude[i]))
    
Hope it helps!!! Good luck!!!    

Thanks. I'll check it out right away.

Edit: It worked better than I expected. I added an additional line of code to make it run:

app = Nominatim(user_agent='myGeocoder')

Great👍. You're welcome.