I'm writing a function that takes in two features and calculates the distance between them. I'm using the geometry.distance module.
Here's my code:
from arcgis.gis import * from arcgis.features import FeatureLayer from arcgis.geocoding import geocode from arcgis import geometry URL = 'url to feature server' QUERY = 'query parameters' def get_features(url, query): ... return features def calculate_distance(feature1, feature2): return geometry.distance('4326', feature1, feature2, distance_unit='meters',\ geodesic=False, gis=None) calculate_distance(features, features)
This is according to the API
geometry.distance(spatial_ref, geometry1, geometry2, distance_unit='', geodesic=False, gis=None), but I get errors when trying to use it.
AttributeError: 'NoneType' object has no attribute '_tools'
How do I use this?