ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Network Source Directions

  • Summary
  • Properties
  • Code sample

Summary

The Network Source Directions object provides information used for generating driving directions that are specific to edge sources in the network dataset.

Properties

PropertyExplanationData Type
adminAreaFieldName
(Read Only)

The name of the field containing the administrative area information for generating driving directions.

If the administrative area information is not defined for the network dataset, adminAreaFieldName property will throw an exception.

String
streetNameFields
(Read Only)

Returns a Python list of Street Name Field objects for this network source.

List
shields
(Read Only)

Returns the Shields object. This object can be used to determine the shield properties used in driving directions. If the shields information is not defined for the network dataset, shields property will throw an exception.

Object

Code sample

Network Source Directions Properties Example

Displays directions information specific to edge sources in the network dataset.

# Name: NDSNetworkSourceDirectionProperties_ex01.py
# Description: Print direction settings specific to edge sources in the network
#              dataset.

import arcpy
import sys

# Set the workspace
arcpy.env.workspace = "C:/Data/SanFrancisco.gdb/Transportation"

# Create Describe object for the network dataset
desc = arcpy.Describe("Streets_ND")

#If the directions are not set for the network dataset, exit 
if not desc.supportsDirections:
    print "No direction information"
    sys.exit() 

print "Source Direction Information ----" 

# Get all the edge sources 
sources = desc.edgeSources 

#If there are no edge sources in the network dataset, quit.
if not sources:
    print "No edge sources"
    sys.exit() 

#Loop through all the edge sources
for source in sources:  
    print "--------------------" 
    print "Name: " , source.name 
    print "Source ID: " , source.sourceID  
    #Print the direction information specific to edge source    
    sDir = source.sourceDirections
    # Check if the administrative area information is defined for the network 
    #dataset. Otherwise adminAreaFieldName property throws an exception 
    if hasattr(sDir, "adminAreaFieldName"):    
        print "Administrative area field: " , sDir.AdminAreaFieldName 
    else:
        print "Administrative area field: " , "Not set"

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal