|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface INACompactStreetDirection
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.
Method Summary | |
---|---|
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. |
Method Detail |
---|
double getLength() throws IOException, AutomationException
Length returns the length of the particular direction element.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getTime() throws IOException, AutomationException
Time returns the travel time of the particular direction element.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String getText() throws IOException, AutomationException
Text returns the text of the particular direction element.
The following lines are examples of what Text might return:
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.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
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.Date getETA() throws IOException, AutomationException
ETA returns the estimated time of arrival at the direction element.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getManeuverType() throws IOException, AutomationException
ManeuverType returns the type of maneuver that the direction represents.
The esriDirectionsManeuverType enumeration has the following values:
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 |