Hi mentors/peer,
We are designing a tool which requires user input address and calculate distance between user location and a list of training data.
We used geopy, geocode to get user lonlat. But after we saved all address from the training data into a list and try to get batch coordinates, the program stops at address geocode can’t convert. How’s this type of error handled in python? please advise based on below codes:
or check:
Notebook: ECSP (created 22 days ago, modified 42 minutes ago)
https://crosscompute.com/u/xW18TKMZEbssWjKababG7HTSFNUB7f7w
Geoprocessing_PC_2.19_practice
CrossCompute
ready_table_path = ‘Ready table with geometry points.csv’
search_radius_in_miles = 5
user_address = ‘28-10 Jackson Ave’ # this address can be located
#user_address = ‘236-238 25TH STREET’ # this is an address geocode can’t locate
target_folder = ‘/tmp’
from geopy import GoogleV3
geocode = GoogleV3(‘AIzaSyDNqc0tWzXHx_wIp1w75-XTcCk4BSphB5w’).geocode
x = geocode(user_address)
if x is None:
print(“No location!”)
skip
else:
user_coor = x.longitude, x.latitude
Load inputs
import pandas as pd
import numpy as np
ready_table = pd.read_csv(ready_table_path)

