I am trying to create a service area analysis layer that uses miles (instead of kilometers) as the impedance value.
Specifically, I am trying to pass a custom TravelMode object to the arcpy.na.MakeServiceAreaAnalysis method and I'm seeing the following error:
ERROR 030232: Invalid travel mode value: "The travel mode has a distance-based impedance attribute that is different from the distance attribute."
Failed to execute (MakeServiceAreaAnalysisLayer).
Here is a minimal (although not reproducible) example of my script:
# Load dependencies
import arcpy
# Source Routing_ND layer
network = "path/to/StreetMapPremium/NorthAmerica.gdb/Routing/Routing_ND"
# Create a list of reference travel modes
travel_modes = arcpy.na.GetTravelModes(network)
# Create a custom travel mode around default 'Driving Distance' travel mode.
new_travel_mode = arcpy.na.TravelMode(travel_modes['Driving Distance'])
# Setting custom travel name and impedance value
# new_travel_mode.name = 'Custom Driving Distance'
new_travel_mode.impedance = 'Miles'
# Create service area analysis layer
result_object = arcpy.na.MakeServiceAreaAnalysisLayer(
network_data_source = network,
layer_name = 'test_layer',
travel_mode = new_travel_mode,
cutoffs = 10)
Any insight is appreciated!
slightly different answer
030232: Invalid travel mode value: <value>.—ArcGIS Pro | Documentation
'Custom Driving Distance' could be it doesn't like spaces in the name
Thank you for the reply. Unfortunately, the code fails regardless of whether I set the new_travel_mode.name attribute or not... I probably should have excluded that from my example. I just commented this out to avoid any confusion.