com.esri.arcgis.networkanalyst
Class NACompactStreetDirectionsAgent

java.lang.Object
  extended by com.esri.arcgis.networkanalyst.NACompactStreetDirectionsAgent
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, INAAgent, INACompactStreetDirectionsAgent, IPersist, IPersistStream, ISupportErrorInfo, Externalizable, Serializable

public class NACompactStreetDirectionsAgent
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, INAAgent, INACompactStreetDirectionsAgent, IPersist, IPersistStream, ISupportErrorInfo, Externalizable

Generates compact driving directions for network analysis results.

Remarks

The NACompactStreetDirectionsAgent object generates driving directions on a route or multiple routes. It generates directions that contain less information and compressed geometries representing the traversed streets. Due to their smaller size, these directions are better suited for passing across low bandwidth connections in server applications. To return these directions using NAServer, rather than using this object directly, set the property INAServerRouteParams2::ReturnCompactDirections or INAServerClosestFacilityParams2::ReturnCompactDirections to true.

You get the NACompactStreetDirectionsAgent from the NAContext's list of agents using the name "CompactStreetDirectionsAgent". For example:

Set pStreetAgent = NAContext.Agents.ItemByName("CompactStreetDirectionsAgent")

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Constructor Summary
NACompactStreetDirectionsAgent()
          Constructs a NACompactStreetDirectionsAgent using ArcGIS Engine.
NACompactStreetDirectionsAgent(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
NACompactStreetDirectionsAgent theNACompactStreetDirectionsAgent = (NACompactStreetDirectionsAgent) obj;
 
Method Summary
 boolean applies(IDENetworkDataset network, INAContextHelper contextHelper)
          Indicates if the agent is appropriate to use with the given network dataset.
 boolean equals(Object o)
          Compare this object with another
 void execute(ISet set, ITrackCancel trackCancel)
          Constructs the directions.
 void getClassID(GUID[] pClassID)
          getClassID
static String getClsid()
          getClsid.
 INACompactStreetDirectionsContainer getDirectionsContainer()
          The container for the directions.
 String getLanguage()
          Language to use when generating directions.
 int getLengthUnits()
          The length units.
 String getName()
          The name of the agent.
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          getSizeMax
 String getTimeAttributeName()
          The network attribute for time calculation.
 int hashCode()
          the hashcode for this object
 void initialize(IDENetworkDataset network, INAContextHelper contextHelper)
          Get the agent ready for action.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void isDirty()
          isDirty
 void load(IStream pstm)
          load
 void onContextUpdated()
          Called when the context is updated.
 void onResultUpdated()
          Called when a result is updated.
 void readExternal(ObjectInput in)
           
 void save(IStream pstm, int fClearDirty)
          save
 void setLanguage(String strLanguage)
          Language to use when generating directions.
 void setLengthUnits(int units)
          The length units.
 void setTimeAttributeName(String name)
          The network attribute for time calculation.
 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

NACompactStreetDirectionsAgent

public NACompactStreetDirectionsAgent()
                               throws IOException,
                                      UnknownHostException
Constructs a NACompactStreetDirectionsAgent using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

NACompactStreetDirectionsAgent

public NACompactStreetDirectionsAgent(Object obj)
                               throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
NACompactStreetDirectionsAgent theNACompactStreetDirectionsAgent = (NACompactStreetDirectionsAgent) obj;

Construct a NACompactStreetDirectionsAgent using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to NACompactStreetDirectionsAgent.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getName

public String getName()
               throws IOException,
                      AutomationException
The name of the agent.

Remarks

Returns the name of the agent. This property is implemented within the agent; there is no need to set this property.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getName in interface INAAgent
Returns:
The agentName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

applies

public boolean applies(IDENetworkDataset network,
                       INAContextHelper contextHelper)
                throws IOException,
                       AutomationException
Indicates if the agent is appropriate to use with the given network dataset.

Remarks

The method Applies is called to determine which agents should be created and attached to the NAContext. Return true if the agent applies.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
applies in interface INAAgent
Parameters:
network - A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
contextHelper - A reference to a com.esri.arcgis.networkanalyst.INAContextHelper (in)
Returns:
The agentApplies
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initialize

public void initialize(IDENetworkDataset network,
                       INAContextHelper contextHelper)
                throws IOException,
                       AutomationException
Get the agent ready for action.

Remarks

Initialize is called when the NAContext::Bind is called and the NAContext is getting into a consistent state.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
initialize in interface INAAgent
Parameters:
network - A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
contextHelper - A reference to a com.esri.arcgis.networkanalyst.INAContextHelper (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onResultUpdated

public void onResultUpdated()
                     throws IOException,
                            AutomationException
Called when a result is updated.

Remarks

OnResultUpdated is called when the NAContext::Result object has been updated. For example, this would be called after INASolver::Solve.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
onResultUpdated in interface INAAgent
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onContextUpdated

public void onContextUpdated()
                      throws IOException,
                             AutomationException
Called when the context is updated.

Remarks

OnContextUpdated is called when the NAContext object has been updated. For example, this would be called after a network location has been added or removed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
onContextUpdated in interface INAAgent
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLengthUnits

public int getLengthUnits()
                   throws IOException,
                          AutomationException
The length units.

Remarks

LengthUnits specifies the length units of the directions in esriNetworkAttributeUnits. The currently supported length units for this property are esriNAUMiles, esriNAUKilometers, esriNAUMeters, esriNAUYards, and esriNAUFeet.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getLengthUnits in interface INACompactStreetDirectionsAgent
Returns:
A com.esri.arcgis.geodatabase.esriNetworkAttributeUnits constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLengthUnits

public void setLengthUnits(int units)
                    throws IOException,
                           AutomationException
The length units.

Remarks

LengthUnits specifies the length units of the directions in esriNetworkAttributeUnits. The currently supported length units for this property are esriNAUMiles, esriNAUKilometers, esriNAUMeters, esriNAUYards, and esriNAUFeet.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setLengthUnits in interface INACompactStreetDirectionsAgent
Parameters:
units - A com.esri.arcgis.geodatabase.esriNetworkAttributeUnits constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTimeAttributeName

public String getTimeAttributeName()
                            throws IOException,
                                   AutomationException
The network attribute for time calculation.

Remarks

TimeAttributeName specifies the name of the time cost attribute used by directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getTimeAttributeName in interface INACompactStreetDirectionsAgent
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTimeAttributeName

public void setTimeAttributeName(String name)
                          throws IOException,
                                 AutomationException
The network attribute for time calculation.

Remarks

TimeAttributeName specifies the name of the time cost attribute used by directions.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setTimeAttributeName in interface INACompactStreetDirectionsAgent
Parameters:
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLanguage

public String getLanguage()
                   throws IOException,
                          AutomationException
Language to use when generating directions.

Remarks

Specifies the Language you want to see the directions in.

This requires that you know which languages are supported by your directions configuration files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getLanguage in interface INACompactStreetDirectionsAgent
Returns:
The strLanguage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLanguage

public void setLanguage(String strLanguage)
                 throws IOException,
                        AutomationException
Language to use when generating directions.

Remarks

Specifies the Language you want to see the directions in.

This requires that you know which languages are supported by your directions configuration files.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setLanguage in interface INACompactStreetDirectionsAgent
Parameters:
strLanguage - The strLanguage (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDirectionsContainer

public INACompactStreetDirectionsContainer getDirectionsContainer()
                                                           throws IOException,
                                                                  AutomationException
The container for the directions.

Remarks

DirectionsContainer provides access to the directions contents.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDirectionsContainer in interface INACompactStreetDirectionsAgent
Returns:
A reference to a com.esri.arcgis.networkanalyst.INACompactStreetDirectionsContainer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

execute

public void execute(ISet set,
                    ITrackCancel trackCancel)
             throws IOException,
                    AutomationException
Constructs the directions.

Remarks

Execute is a method to compute the driving directions. This method takes a set containing the route features that you want to generate directions for. If null is passed in, it will generate directions for all routes. If you want to generate directions for a subset of the routes, create a new set object and add route features from the corresponding Routes or CFRoutes network analysis class.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
execute in interface INACompactStreetDirectionsAgent
Parameters:
set - A reference to a com.esri.arcgis.system.ISet (in)
trackCancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClassID

public void getClassID(GUID[] pClassID)
                throws IOException,
                       AutomationException
getClassID

Description

IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getClassID in interface IPersist
Parameters:
pClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isDirty

public void isDirty()
             throws IOException,
                    AutomationException
isDirty

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isDirty in interface IPersistStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

load

public void load(IStream pstm)
          throws IOException,
                 AutomationException
load

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
load in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

save

public void save(IStream pstm,
                 int fClearDirty)
          throws IOException,
                 AutomationException
save

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
save in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
fClearDirty - The fClearDirty (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSizeMax

public void getSizeMax(_ULARGE_INTEGER[] pcbSize)
                throws IOException,
                       AutomationException
getSizeMax

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSizeMax in interface IPersistStream
Parameters:
pcbSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException