|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface INALocator
Provides access to properties that apply to all network locators.
INALocator has been superseded by INALocator3.
Method Summary | |
---|---|
void |
addLocatorAgent(INALocatorAgent locatorAgent)
Add a locator agent. |
void |
bind(INetworkDataset pNetworkDataset,
IGPMessages pGPMessages)
Re-associate the locators with the given network dataset and its schema. |
void |
createDefault(IDENetworkDataset network)
Make the default locators. |
INALocatorAgent |
getLocatorAgent(int index)
The locator agent by index. |
int |
getLocatorAgentCount()
The number of locator agents added. |
INetworkDataset |
getNetworkDataset()
The associated network dataset. |
ISpatialReference |
getOutputSpatialReference()
The spatial reference for points returned by the locator. |
double |
getSnapTolerance()
The distance to search. |
int |
getSnapToleranceUnits()
The units of the snap tolerance. |
boolean |
isFindClosestAmongAllAgents()
Indicates if the closest location (only) should be returned. |
void |
queryLocationByPoint(IPoint point,
INALocation[] location,
IPoint[] outPoint,
double[] distanceFromPoint)
Use the locator agents to find a network location from a point. |
void |
queryLocationByRow(IRow row,
INALocation[] location,
double[] distanceFromRow)
Use the locator agents to find a network location from a row. |
void |
queryPoint(INALocation location,
IPoint[] point)
The point for a network location. |
void |
removeLocatorAgent(int index)
Remove a locator agent by index. |
void |
setFindClosestAmongAllAgents(boolean findClosest)
Indicates if the closest location (only) should be returned. |
void |
setOutputSpatialReferenceByRef(ISpatialReference spatialReference)
The spatial reference for points returned by the locator. |
void |
setSnapTolerance(double tolerance)
The distance to search. |
void |
setSnapToleranceUnits(int units)
The units of the snap tolerance. |
Method Detail |
---|
INetworkDataset getNetworkDataset() throws IOException, AutomationException
The NetworkDataset property holds a reference to the NetworkDataset that the locator is bound to and is used for locating network locations. The property is set by calling INALocator::Bind.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setSnapTolerance(double tolerance) throws IOException, AutomationException
The SnapTolerance property specifies the minimum search tolerance used when finding network locations. If nothing is found within this tolerance, the search tolerance is doubled until a network location is found or INALocator2::MaxSnapTolerance is reached.
tolerance
- The tolerance (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getSnapTolerance() throws IOException, AutomationException
The SnapTolerance property specifies the minimum search tolerance used when finding network locations. If nothing is found within this tolerance, the search tolerance is doubled until a network location is found or INALocator2::MaxSnapTolerance is reached.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setSnapToleranceUnits(int units) throws IOException, AutomationException
SnapToleranceUnits determines how the SnapTolerance number is interpreted.
units
- A com.esri.arcgis.system.esriUnits constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getSnapToleranceUnits() throws IOException, AutomationException
SnapToleranceUnits determines how the SnapTolerance number is interpreted.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setFindClosestAmongAllAgents(boolean findClosest) throws IOException, AutomationException
FindClosestAmongAllAgents specifies if you want to search among all locator agents or not.
When you have many network sources, you may want to stop once you find a location within the search tolerance of one of the agents. If this is the case, set FindClosestAmongAllAgents to false and the first locator to find a location will stop the search.
findClosest
- The findClosest (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isFindClosestAmongAllAgents() throws IOException, AutomationException
FindClosestAmongAllAgents specifies if you want to search among all locator agents or not.
When you have many network sources, you may want to stop once you find a location within the search tolerance of one of the agents. If this is the case, set FindClosestAmongAllAgents to false and the first locator to find a location will stop the search.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getLocatorAgentCount() throws IOException, AutomationException
LocatorAgentCount returns the number of locator agents that the NALocator is referencing.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.INALocatorAgent getLocatorAgent(int index) throws IOException, AutomationException
index
- The index (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void createDefault(IDENetworkDataset network) throws IOException, AutomationException
CreateDefault will examine the network sources for the inbound network dataset and set up a locator agent for each source as appropriate. Each locator agent is then added to the LocatorAgent collection of the NALocator. Sources that do not support NALocations, like Turn and Hyperedge sources, will not have a locator agent.
network
- A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void addLocatorAgent(INALocatorAgent locatorAgent) throws IOException, AutomationException
AddLocatorAgent adds a locator agent to the NALocator's collection.
locatorAgent
- A reference to a com.esri.arcgis.networkanalyst.INALocatorAgent (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void removeLocatorAgent(int index) throws IOException, AutomationException
RemoveLocatorAgent removes a locator agent from the NALocator's collection.
index
- The index (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void queryLocationByPoint(IPoint point, INALocation[] location, IPoint[] outPoint, double[] distanceFromPoint) throws IOException, AutomationException
Using the input Point object, this method calls QueryLocationByPoint on each of its associated NALocatorAgent classes. The corresponding NALocation, the point where the location was found, and the distance from the input point to the source feature found are all returned.
Generally, the NALocator used for this method should be retrieved from a NAContext. However, if you do create a NALocator, or have added a new locator agent, then, before querying the NALocator, Bind should be called on the NALocator to set up the locator agents and associate it with the NetworkDataset.
QueryLocationByPoint searches for network locations based upon an input point. When the NALocatorFeatureAgent is used, the distance returned is from the point to the feature, not from the point to the actual network location on the feature. It is important to know the distance to the feature as a whole because this is the feature on which you want to locate the endpoint/midpoint. If you need to determine the distance from the input point to the actual network location point, use IProximityOperator::ReturnDistance between the input point and the output point.
If FindClosestAmongAllAgents is false, it will return after the first locator succeeds in finding a location.
The output geometry is returned in the spatial reference of the network dataset. Optionally, set an OutputSpatialReference on the NALocator.
point
- A reference to a com.esri.arcgis.geometry.IPoint (in)location
- A reference to a com.esri.arcgis.networkanalyst.INALocation (in/out: use single element array)outPoint
- A reference to a com.esri.arcgis.geometry.IPoint (in/out: use single element array)distanceFromPoint
- The distanceFromPoint (in/out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void queryLocationByRow(IRow row, INALocation[] location, double[] distanceFromRow) throws IOException, AutomationException
Using the inbound Row object, the method calls QueryLocationByRow on each of its associated NALocatorAgent classes. If FindClosestAmongAllAgents is false, it will return after the first locator succeeds in finding a location.
row
- A reference to a com.esri.arcgis.geodatabase.IRow (in)location
- A reference to a com.esri.arcgis.networkanalyst.INALocation (in/out: use single element array)distanceFromRow
- The distanceFromRow (in/out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void queryPoint(INALocation location, IPoint[] point) throws IOException, AutomationException
QueryPoint returns the spatial location of an NALocation. This method may be used after calling QueryLocationByRow in order to get its spatial location.
The output geometry is returned in the spatial reference of the network dataset. Optionally set an OutputSpatialReference on the NALocator.
location
- A reference to a com.esri.arcgis.networkanalyst.INALocation (in)point
- A reference to a com.esri.arcgis.geometry.IPoint (in/out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void bind(INetworkDataset pNetworkDataset, IGPMessages pGPMessages) throws IOException, AutomationException
Bind will associate all of the contained NALocator objects with the input network dataset specified. This method must be called before calling any of the Query functions.
pNetworkDataset
- A reference to a com.esri.arcgis.geodatabase.INetworkDataset (in)pGPMessages
- A reference to a com.esri.arcgis.geodatabase.IGPMessages (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setOutputSpatialReferenceByRef(ISpatialReference spatialReference) throws IOException, AutomationException
spatialReference
- A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISpatialReference getOutputSpatialReference() throws IOException, AutomationException
The OutputSpatialReference property determines the spatial reference used for results.
If the OutputSpatialReference for a NALocator attached to a NAContext is set as null, it is assumed to be the same as the spatial reference of the network dataset to which the NAContext is bound.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |