OpenLR - map

The map package consists of the map interface and tools being used by the OpenLR encoder and decoder. The user of this package needs to implement the required methods and needs to translate the internal data structure to the OpenLR map interface.

The map interface consists of the Java interfaces:

  • MapDatabase This interface provides methods to find lines by their id, to find nodes close to a given coordinate and it handles turn restrictions (if applicable).
  • Line This interface represents a line in a network. It provides methods to access its start and end node, its connected lines and attributes like line length, functional road class and form of way.
  • Node This interface represents a node in a network. It provides methods to resolve the coordinates at which the node is placed and its connected lines.

The package also defines two enumerations:

  • FunctionalRoadClass The FunctionalRoadClass (FRC) is a classification based on the importance of the role that a line performs in the connectivity of the total road network. Each line in a road network should have a FRC value attached. The user needs to map the internal map representation onto the OpenLR values. The mapping should start with the most important class (FRC 0). There is no need to map all eight OpenLR values.
  • FormOfWay The FormOfWay (FOW) describes certain aspects of the physical form that a line in a road network takes. It is based on a number of certain physical and traffic properties. Each line within a road network should have a FOW value attached. The user needs to map the internal map representation onto the OpenLR values. There is no need to map all eight OpenLR values.

The map package also defines interfaces for loading the map data. These interfaces can be used to make the map data available for other applications like the OpenLR MapViewer. The map load can be parameterized using map load parameter. These parameter can be of type "File", "Directory" or "String". The map loader needs to handle the parameters correctly and it returns the map database.

Additionally this package provides utility classes which deals with

  • paths in the network
  • distance and bearing calculation
  • validity check of nodes
  • helper methods for iterators.