For each exit, compute the distance to the nearest power substation...
#Import packages
from arcgis import GIS
from arcgis.features import FeatureLayer, analysis
import pandas as pd
import geopandas as gpd
import os
#Fetch exit data into a spatially enabled dataframe
data_url = 'https://services7.arcgis.com/fqNd6NEGNf5qzQdv/arcgis/rest/services/TCI_NC_exits_2019_06_11_v1/FeatureServer/1'
lyr_exits = FeatureLayer(data_url)
sdf_exits = lyr_exits.query("State = 'NC'").sdf
#Save
if not os.path.exists('./Data/MJBA'): os.mkdir('./Data/MJBA')
sdf_exits.spatial.to_featureclass(location='/Data/MJBA/Exits.shp')
#Fetch power substation data
data_url = 'https://services1.arcgis.com/Hp6G80Pky0om7QvQ/ArcGIS/rest/services/Electric_Substations_1/FeatureServer/0'
sdf_substations = FeatureLayer(data_url).query("State = 'NC'").sdf
#Save
if not os.path.exists('./Data/HILFD'): os.mkdir('./Data/HILFD')
sdf_exits.spatial.to_featureclass(location='/Data/HILFD/Substations.shp')
sdfLyr = sdf_exits.spatial.to_featurelayer("Exits")
#Find the nearest substation to each exit
foo = analysis.find_nearest(sdf_exits.to_featurelayer("Exits"))