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


INALocator3.CacheRestrictedElements Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (NetworkAnalyst)  

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 _
)
[C#]
public void CacheRestrictedElements (
    INAContext Context
);
[C++]
HRESULT CacheRestrictedElements(
  INAContext* Context
);
[C++]

Parameters Context [in]
Context is a parameter of type INAContext

Product Availability

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

Remarks

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 (Code Files: frmClosestFacilitySolver) | ArcGIS Network Analyst extension Engine application (Code Files: frmLoadLocations) | Service area solver (Code Files: frmServiceAreaSolver) | Location-allocation solver (Code Files: frmLocationAllocationSolver) | Vehicle routing problem solver (Code Files: frmVRPSolver) | Origin-destination cost matrix solver (Code Files: frmODCostMatrixSolver) | Route layer (Code Files: Program)

.NET Related Topics

How to load data into a network analysis problem | How to setup, solve, and save a network analysis problem