How to use the arcgis.geometry.distance function in arcgis

To help you get started, we’ve selected a few arcgis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codeforboston / voiceapp311 / mycity / mycity / utilities / gis_utils.py View on Github external
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']