Network Analyst Locator

サマリー

Provides the source, snap type, and search query information about the classes that are used to determine the network locations.

説明

The source, snapType, and searchQuery properties for the locator object are dynamic. This means that the total number of properties supported by a given locator object depends on the locatorCount property. For example, if the value of the locatorCount property is 2, then the locator object will support source0, source1, snapType0, snapType1, searchQuery0, and seacrhQuery1 properties.

プロパティ

プロパティ説明データ タイプ
sourceX
(読み取り専用)

The name of a particular class used by the locator.

String
snapTypeX
(読み取り専用)

An underscore-separated string containing the snap types used for a given class in the locator.

The possible snap types are

  • NONE
  • SHAPE
  • MIDDLE
  • END
String
searchQueryX
(読み取り専用)

A query to restrict the search to a subset of the features within a given class in the locator.

String

コードのサンプル

Network Analyst Locator example

Displays the Network Analyst Layer Locator properties.

# Name: NALayerLocatorProperties_ex01.py
# Description: Prints the source name and snap type information
#              for the locators used by a network analysis layer

import arcpy

in_layer = "C:/Data/Route.lyr" 

# Create a Describe object from layer file.
desc = arcpy.Describe(in_layer) 

count = desc.locatorCount 
locators = desc.locators 

#print locator information
print "Total Locators: ", count 
for i in range(0, count): 
    sourceName = getattr(locators,"source" + str(i))
    snapType = getattr(locators,"snapType" + str(i))
    query = getattr(locators, "searchQuery" + str(i))
    print "%s : %s : %s" % (sourceName,snapType, query)