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 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

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Network Analyst Locator

  • Summary
  • Discussion
  • Properties
  • Code sample

Summary

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

Discussion

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.

Properties

PropertyExplanationData Type
sourceX
(Read Only)

The name of a particular class used by the locator.

String
snapTypeX
(Read Only)

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
(Read Only)

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

String

Code sample

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)

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

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