HOW TO
In many cases when using Network Analyst it may be desirable to restrict use of certain edges of the network. For example, only roads that can be walked along or only roads that allow delivery vehicles should be traversed. At ArcMap 10.1, Python can be used to create attribute restrictions. Instructions provided in this article describe the steps to create field-based attribute restrictions using Python scripting.
Code:
def PedestrianOnly(pedestrian, highway):
restricted = False
if pedestrian in ('N'):
restricted = True
elif highway in ('Y'):
restricted = True
return restricted
PedestrianOnly(!PEDESTRIAN!, !HIGHWAY!)
Get help from ArcGIS experts
Download the Esri Support App