Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def calculate_distance(feature1, feature2):
"""
:param feature1: the first feature
:param feature2: the second feature
:return: the distance (in meters) between these two addresses
"""
geometry1 = feature1 # feature1 is the address, which is already a geometry
geometry2 = feature2['geometry']
spatial_ref = {"wkid": 4326}
return geometry.distance(spatial_ref,
geometry1,
geometry2,
distance_unit='',
geodesic=True)['distance']