|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.esri.arcgis.networkanalyst.NALocator
public class NALocator
Finds network locations for analysis.
NALocator is a top-level container for managing and using network locators. It has a collection of Locator Agents that do the work of finding the locations.
While NALocators are CoCreateable, you typically get the NALocator from the NAContext, which sets up the locator appropriately for the network dataset and type of analysis.
| Constructor Summary | |
|---|---|
NALocator()
Constructs a NALocator using ArcGIS Engine. |
|
NALocator(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. NALocator theNALocator = (NALocator) obj; |
|
| Method Summary | |
|---|---|
void |
addLocatorAgent(INALocatorAgent locatorAgent)
Add a locator agent. |
void |
assign(IClone src)
Assigns the properties of src to the receiver. |
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. |
boolean |
equals(Object o)
Compare this object with another |
IClone |
esri_clone()
Clones the receiver and assigns the result to *clone. |
INALocation |
geocodeLocation(String address,
ILocator addressLocator)
The network location at the specified address. |
void |
getClassID(GUID[] pClassID)
getClassID |
static String |
getClsid()
getClsid. |
INALocatorAgent |
getLocatorAgent(int index)
The locator agent by index. |
int |
getLocatorAgentCount()
The number of locator agents added. |
double |
getMaxSnapTolerance()
The maximum distance that can be searched when expanding the snap tolerance. |
INetworkDataset |
getNetworkDataset()
The associated network dataset. |
ISpatialReference |
getOutputSpatialReference()
The spatial reference for points returned by the locator. |
void |
getSizeMax(_ULARGE_INTEGER[] pcbSize)
getSizeMax |
double |
getSnapTolerance()
The distance to search. |
int |
getSnapToleranceUnits()
The units of the snap tolerance. |
int |
hashCode()
the hashcode for this object |
void |
isDirty()
isDirty |
boolean |
isEqual(IClone other)
Returns TRUE when the receiver and other have the same properties. |
boolean |
isFindClosestAmongAllAgents()
Indicates if the closest location (only) should be returned. |
boolean |
isIdentical(IClone other)
Returns TRUE when the receiver and other are the same object. |
void |
load(IStream pstm)
load |
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 |
queryOffsetPoint(INALocation location,
double offset,
int units,
IPoint[] point)
The point offset from a network location. |
void |
queryPoint(INALocation location,
IPoint[] point)
The point for a network location. |
void |
readExternal(ObjectInput in)
|
void |
removeLocatorAgent(int index)
Remove a locator agent by index. |
String |
reverseGeocodeLocation(INALocation location,
ILocator addressLocator)
The address of the network location. |
void |
save(IStream pstm,
int fClearDirty)
save |
void |
setFindClosestAmongAllAgents(boolean findClosest)
Indicates if the closest location (only) should be returned. |
void |
setMaxSnapTolerance(double maxTolerance)
The maximum distance that can be searched when expanding the snap tolerance. |
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. |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef |
|---|
getJintegraDispatch, release |
| Constructor Detail |
|---|
public NALocator()
throws IOException,
UnknownHostException
IOException - if there are interop problems
UnknownHostException - if there are interop problems
public NALocator(Object obj)
throws IOException
NALocator theNALocator = (NALocator) obj;
obj to NALocator.
obj - an object returned from ArcGIS Engine or Server
IOException - if there are interop problems| Method Detail |
|---|
public static String getClsid()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
public 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.
getNetworkDataset in interface INALocatorIOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public 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.
setSnapTolerance in interface INALocatortolerance - The tolerance (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public 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.
getSnapTolerance in interface INALocatorIOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void setSnapToleranceUnits(int units)
throws IOException,
AutomationException
SnapToleranceUnits determines how the SnapTolerance number is interpreted.
setSnapToleranceUnits in interface INALocatorunits - A com.esri.arcgis.system.esriUnits constant (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public int getSnapToleranceUnits()
throws IOException,
AutomationException
SnapToleranceUnits determines how the SnapTolerance number is interpreted.
getSnapToleranceUnits in interface INALocatorIOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public 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.
setFindClosestAmongAllAgents in interface INALocatorfindClosest - The findClosest (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public 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.
isFindClosestAmongAllAgents in interface INALocatorIOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public int getLocatorAgentCount()
throws IOException,
AutomationException
LocatorAgentCount returns the number of locator agents that the NALocator is referencing.
getLocatorAgentCount in interface INALocatorIOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public INALocatorAgent getLocatorAgent(int index)
throws IOException,
AutomationException
getLocatorAgent in interface INALocatorindex - The index (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public 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.
This method will return an error if the NALocator has already been tied to a network dataset using the Bind method.
createDefault in interface INALocatornetwork - A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void addLocatorAgent(INALocatorAgent locatorAgent)
throws IOException,
AutomationException
AddLocatorAgent adds a locator agent to the NALocator's collection.
addLocatorAgent in interface INALocatorlocatorAgent - A reference to a com.esri.arcgis.networkanalyst.INALocatorAgent (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void removeLocatorAgent(int index)
throws IOException,
AutomationException
RemoveLocatorAgent removes a locator agent from the NALocator's collection.
removeLocatorAgent in interface INALocatorindex - The index (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public 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.
queryLocationByPoint in interface INALocatorpoint - 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.
public 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.
queryLocationByRow in interface INALocatorrow - 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.
public 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.
queryPoint in interface INALocatorlocation - 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.
public 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.
bind in interface INALocatorpNetworkDataset - 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.
public void setOutputSpatialReferenceByRef(ISpatialReference spatialReference)
throws IOException,
AutomationException
setOutputSpatialReferenceByRef in interface INALocatorspatialReference - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public 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.
getOutputSpatialReference in interface INALocatorIOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public double getMaxSnapTolerance()
throws IOException,
AutomationException
The INALocator::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 MaxSnapTolerance is reached.
getMaxSnapTolerance in interface INALocator2IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void setMaxSnapTolerance(double maxTolerance)
throws IOException,
AutomationException
The INALocator::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 MaxSnapTolerance is reached.
setMaxSnapTolerance in interface INALocator2maxTolerance - The maxTolerance (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void queryOffsetPoint(INALocation location,
double offset,
int units,
IPoint[] point)
throws IOException,
AutomationException
QueryOffsetPoint returns the spatial location of an NALocation after applying the offset distance and units specified. If the location occurs along a line, the (input location parameter) INALocation.Side property indicates whether the offset occurs to the left or right of the digitized direction of the line. In other words, if the location is on the left side, the offset occurs to the left. For locations on junctions, nothing is offset.
Generally, the NALocator 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 agents and associate it with the NetworkDataset.
The output geometry is returned in the spatial reference of the network dataset. Optionally, set an OutputSpatialReference on the NALocator.
queryOffsetPoint in interface INALocator2location - A reference to a com.esri.arcgis.networkanalyst.INALocation (in)offset - The offset (in)units - A com.esri.arcgis.system.esriUnits constant (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.
public String reverseGeocodeLocation(INALocation location,
ILocator addressLocator)
throws IOException,
AutomationException
ReverseGeocodeLocation returns the text address of an NALocation based on the address locator specified.
reverseGeocodeLocation in interface INALocator2location - A reference to a com.esri.arcgis.networkanalyst.INALocation (in)addressLocator - A reference to a com.esri.arcgis.geodatabase.ILocator (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public INALocation geocodeLocation(String address,
ILocator addressLocator)
throws IOException,
AutomationException
GeocodeLocation returns an NALocation based on the input address and address locator specfied.
It does this by using the point returned by the address locator and then iterating through the NALocator's locator agents calling QueryLocationByPoint.
geocodeLocation in interface INALocator2address - The address (in)addressLocator - A reference to a com.esri.arcgis.geodatabase.ILocator (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IClone esri_clone()
throws IOException,
AutomationException
esri_clone in interface ICloneIOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void assign(IClone src)
throws IOException,
AutomationException
assign in interface IClonesrc - A reference to a com.esri.arcgis.system.IClone (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public boolean isEqual(IClone other)
throws IOException,
AutomationException
IsEqual returns True if the receiver and the source have the same properties. Note, this does not imply that the receiver and the source reference the same object.
isEqual in interface ICloneother - A reference to a com.esri.arcgis.system.IClone (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public boolean isIdentical(IClone other)
throws IOException,
AutomationException
IsIdentical returns true if the receiver and the source reference the same object.
isIdentical in interface ICloneother - A reference to a com.esri.arcgis.system.IClone (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void isDirty()
throws IOException,
AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
isDirty in interface IPersistStreamIOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void load(IStream pstm)
throws IOException,
AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
load in interface IPersistStreampstm - A reference to a com.esri.arcgis.system.IStream (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void save(IStream pstm,
int fClearDirty)
throws IOException,
AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
save in interface IPersistStreampstm - A reference to a com.esri.arcgis.system.IStream (in)fClearDirty - The fClearDirty (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void getSizeMax(_ULARGE_INTEGER[] pcbSize)
throws IOException,
AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
getSizeMax in interface IPersistStreampcbSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void getClassID(GUID[] pClassID)
throws IOException,
AutomationException
IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.
getClassID in interface IPersistpClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOException
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||