Global Positioning System Reference
In-Depth Information
sequential IDs on the fly. The nodeToLinks[nd] array returns a set of links
for every node nd without a lookup operation, and the first dimension of
the graph is complete. The actual two-dimensional graph is created with
mapGraph = new Link[nodeToLinks.length][];
The second dimension of the graph has not been defined yet. It could be
created once using the maximum number of links for a node to leave a lot
of null elements in the array. Here, the special implementation of more-
dimensional arrays in Java comes in handy. Internally, Java only works
with one-dimensional arrays and additional dimensions are modeled with
arrays of arrays. This can be used to create individual arrays for every
from node (first dimension):
mapGraph = new Link[nodeToLinks.length][];
for (int from = 0; from < nodeToLinks.length; from++)
mapGraph[from] = nodeToLinks[from].toArray( new Link[0] );
The result is a two-dimensional array mapGraph of links:
Link[all nodes in sequential order][reachable nodes]
The internal development (private methods) of the navigable map pro-
vides the platonic structure for navigational operations:
1. external selection of a destination D in nodeMap via list or via geo
coordinates;
2. finding the number of neighbors via mapGraph[D].length ;
3. evaluating each connecting link (distance, feature, etc.)
via link=
mapGraph[D][neighbor]
4. traversing the graph until one of the neighbors is identified as the
destination.
Finally, the Link itself describes how to drive from a node to a neighbor.
The private visibility of the graph prevents direct access by external clients.
(The next chapter will introduce customized basic navigational methods.)
8.5
Conclusion
The basics of map compilations have now been outlined and the reader
should be able to configure his own map compiler to produce a PSF for
his own application. The work of a map engineer, however, is dominated
by planing. Any fix should be applied before going home in the evening in
order to run a test overnight and get the result in the morning. The worst
case scenario is kicking-off a compilation on Friday afternoon to use the
 
Search WWH ::




Custom Search