This document is archived and information here might be outdated.  Recommended version.

INALocator3.CacheRestrictedElements Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > NetworkAnalyst > ESRI.ArcGIS.NetworkAnalyst > Interfaces > IN > INALocator3 Interface > INALocator3.CacheRestrictedElements Method
ArcGIS Developer Help

INALocator3.CacheRestrictedElements Method

The locator will examine the NAContext and its associated NASolver to build a cache of network elements that cannot be located on due to restrictions, barriers, etc. This method should be called before querying the locator whenever ExcludeRestrictedElements i

[Visual Basic .NET]
Public Sub CacheRestrictedElements ( _
    ByVal Context As INAContext _
public void CacheRestrictedElements (
    INAContext Context
HRESULT CacheRestrictedElements(
  INAContext* Context
Context [in]

Context is a parameter of type INAContext*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Network Analyst Extension.


Use this method in conjunction with INALocator3::ExcludeRestrictedElements, in order to avoid loading locations on elements where travel is not allowed. If you set ExcludeRestrictedElements to true, then before calling any of the query location methods, be sure to call CacheRestrictedElements in order to inform the NALocator of the restrictions of which the passed-in NAContext is currently aware.  Subsequently, if any changes are made to solver restrictions, impedances attributes or solver barriers, be sure to call CacheRestrictedElements so that the locator can avoid locating on restricted network elements.

Note that it is appropriate to locate barriers on restricted elements. Therefore, when loading barriers, ExcludeRestrictedElements should be set to false.  If loading is done via the NAClassLoader then the caller must call CacheRestrictedElements prior to using the NAClassLoader but the NAClassLoader will internally set ExcludeRestrictedElements to be false when loading any barrier NAClass.

See Also

INALocator3 Interface

.NET Samples

Closest facility solver Location-allocation solver ArcGIS Network Analyst extension Engine application Origin-destination cost matrix solver Route layer Service area solver Vehicle routing problem solver