|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.interop.Dispatch com.esri.arcgis.networkanalyst.INACompactStreetDirectionProxy
public class INACompactStreetDirectionProxy
Provides access to a compact street direction item.
The INACompactStreetDirection interface provides access to each direction element. The NACompactStreetDirection object this interface accesses is significantly smaller than the NAStreetDirection object accessed via the INAStreetDirection interface. In particular, there is less information stored about the direction, and the geometry representing the traversed streets is highly compressed. Due to their smaller size, these directions are better suited for passing across low bandwidth connections in server applications.
Field Summary | |
---|---|
boolean |
noncastable
|
Fields inherited from class com.esri.arcgis.interop.Dispatch |
---|
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef |
Constructor Summary | |
---|---|
|
INACompactStreetDirectionProxy()
|
|
INACompactStreetDirectionProxy(Object obj)
|
protected |
INACompactStreetDirectionProxy(Object obj,
String iid)
|
Method Summary | |
---|---|
void |
addListener(String iidStr,
Object theListener,
Object theSource)
|
String |
getCompressedGeometry()
The compressed geometry for the driving direction. |
Date |
getETA()
The estimated time of arrival. |
double |
getLength()
The cumulative driving length (in directions length units). |
int |
getManeuverType()
The maneuver type. |
String |
getText()
The driving direction text. |
double |
getTime()
The time spent. |
void |
removeListener(String iidStr,
Object theListener)
|
Methods inherited from class com.esri.arcgis.interop.Dispatch |
---|
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean noncastable
Constructor Detail |
---|
public INACompactStreetDirectionProxy()
public INACompactStreetDirectionProxy(Object obj) throws IOException
IOException
protected INACompactStreetDirectionProxy(Object obj, String iid) throws IOException
IOException
Method Detail |
---|
public void addListener(String iidStr, Object theListener, Object theSource) throws IOException
addListener
in class com.esri.arcgis.interop.Dispatch
IOException
public void removeListener(String iidStr, Object theListener) throws IOException
removeListener
in class com.esri.arcgis.interop.Dispatch
IOException
public double getLength() throws IOException, AutomationException
Length returns the length of the particular direction element.
getLength
in interface INACompactStreetDirection
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public double getTime() throws IOException, AutomationException
Time returns the travel time of the particular direction element.
getTime
in interface INACompactStreetDirection
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getText() throws IOException, AutomationException
Text returns the text of the particular direction element.
The following lines are examples of what Text might return:
getText
in interface INACompactStreetDirection
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getCompressedGeometry() throws IOException, AutomationException
CompressedGeometry returns a compressed line geometry representing the direction. By compressing the geometry, the overall size of the direction item is significantly reduced.
The direction's line geometry is compressed by the directions agent. It compresses it by converting the line geometry into a string that holds the relative offsets of the points in the line as integers stored in 32-based notation.
Here is a description of the compression algorithm that is used:
Input to compression:
dirPoints - Direction's line geometry as a collection of points
coefficient - Integer to multiply each x and y double by when converting to integer
Output:
compressedGeometry - String representing geometry
1. Convert coefficient to string and add to the start of the compressedGeometry string
2. set pointPrev = (0,0)
3. For each point in dirPoints
a. int xDifference = Round(coefficient * (point.x - pointPrev.x))
b. Int yDifference = Round(coefficient * (point.y - pointPrev.y))
c. Convert xDifference to string using 32-based scale and add to compressedGeometry string
d. Convert yDifference to string using 32-based scale and add to compressedGeometry string
e. pointPrev = point;
4. return compressedGeometry string
To extract the points for the line geometry from the CompressedGeometry string, the reverse of the above must be done. It is necessary to get the first integer from the string and convert it to an integer to be used as the coefficient. Then, pop off each remaining substring and convert it back into a double.
Here is a description of the uncompression algorithm:
Input to decompression:
compressedGeometry - String representing geometry
Output:
dirPoints - Direction's line geometry as a collection of points
1. get first token from compressedGeometry string and convert to integer to use as the coefficient
2. xDiffPrev = 0, yDiffPrev = 0
3. For each point in dirPoints
a. xDiff = get token from compressedGeometry string and convert from 32-based scale to integer
b. yDiff = get token from compressedGeometry string and convert from 32-based scale to integer
c. point.x = (xDiff + xDiffPrev) / coefficient
e. point.y = (yDiff + yDiffPrev) / coeffiecint
f. add point to dirPoints
g. xDiffPrev = xDiff, yDiffPrev = yDiff
4. return dirPoints
Thus, with the following input data:
dirPoints:
-118.356654545455, 34.1146
-118.356436363636, 34.1143272727273
-118.356418181818, 34.1142363636364
-118.356490909091, 34.1137636363636
coefficient:
55000 - represents 2 meter resolution
It would be compressed into the following string:
"+1lmo-66l1f+1p8af+c-f+1-5-4-q"
When uncompressed, the resulting points would be the following (slightly different due to lossy compression):
-118.356636363636, 34.1146
-118.356418181818, 34.1143272727273
-118.3564, 34.1142363636364
-118.356472727273, 34.1137636363636
getCompressedGeometry
in interface INACompactStreetDirection
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Date getETA() throws IOException, AutomationException
ETA returns the estimated time of arrival at the direction element.
getETA
in interface INACompactStreetDirection
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getManeuverType() throws IOException, AutomationException
ManeuverType returns the type of maneuver that the direction represents.
The esriDirectionsManeuverType enumeration has the following values:
getManeuverType
in interface INACompactStreetDirection
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 |