openlr.map
Interface MapDatabase


public interface MapDatabase

The Interface MapDatabase is the geospatial representation of an area on the earth surface. A map database of a road network holds lines and nodes whereby the lines represent the roads and the nodes represent start and end of lines as well as intersections of lines.

A map database representing a road network might also hold information about turn restrictions. Paths in a network might not be drivable in a certain sequence.

OpenLR is a trade mark of TomTom International B.V.

email: software@openlr.org

Author:
TomTom International B.V.

Method Summary
 Iterator<Line> findLinesCloseByCoordinate(double longitude, double latitude, int distance)
          Returns a set of lines in the road network which are within a distance of distance meter away from the position arguments (latitude, longitude).
 Iterator<Node> findNodesCloseByCoordinate(double longitude, double latitude, int distance)
          Returns a set of nodes in the road network which are within a distance of distance meter away from the position arguments (latitude, longitude).
 Iterator<Line> getAllLines()
          Returns all lines.
 Iterator<Node> getAllNodes()
          Returns all nodes.
 Line getLine(long id)
          Returns the line of the road network with the ID id.
 Rectangle2D.Double getMapBoundingBox()
          Gets the bounding box of the map.
 Node getNode(long id)
          Returns the node of the road network with the ID id.
 int getNumberOfLines()
          Returns the number of lines.
 int getNumberOfNodes()
          Returns the number of nodes.
 boolean hasTurnRestrictionOnPath(List<? extends Line> path)
          Checks for turn restrictions on a path.
 boolean hasTurnRestrictions()
          Checks if the map database also holds information on turn restrictions.
 

Method Detail

hasTurnRestrictions

boolean hasTurnRestrictions()
Checks if the map database also holds information on turn restrictions.

Returns:
true, if the map database holds information on turn restrictions, otherwise false

getLine

Line getLine(long id)
Returns the line of the road network with the ID id. If the map database holds no line with that ID, it will return null.

Parameters:
id - the id of the requested line
Returns:
the line with ID id or null if no line with that ID exists

getNode

Node getNode(long id)
Returns the node of the road network with the ID id. If the map database holds no node with that ID, it will return null.

Parameters:
id - the id of the requested node
Returns:
the node with ID id or null if no node with that ID exists

findNodesCloseByCoordinate

Iterator<Node> findNodesCloseByCoordinate(double longitude,
                                          double latitude,
                                          int distance)
Returns a set of nodes in the road network which are within a distance of distance meter away from the position arguments (latitude, longitude). The coordinates shall be in the WGS84 format and the distance argument shall be measured in meter. The implementation shall ensure that nodes with a greater distance are not included in the return set!

Parameters:
latitude - the latitude of the position
longitude - the longitude of the position
distance - the radius around the position where the nodes should be located
Returns:
a set of nodes being at most distance meters away from the position

findLinesCloseByCoordinate

Iterator<Line> findLinesCloseByCoordinate(double longitude,
                                          double latitude,
                                          int distance)
Returns a set of lines in the road network which are within a distance of distance meter away from the position arguments (latitude, longitude). The coordinates shall be in the WGS84 format and the distance argument shall be measured in meter. The implementation shall ensure that lines with a greater distance are not included in the return set!

Parameters:
latitude - the latitude of the position
longitude - the longitude of the position
distance - the radius around the position where the lines should be located
Returns:
a set of lines being at most distance meters away from the position

hasTurnRestrictionOnPath

boolean hasTurnRestrictionOnPath(List<? extends Line> path)
Checks for turn restrictions on a path. Turn restrictions always limit the number of drivable paths in a road network. A path consists of an ordered and connected sequence of lines. If a turning along a path is not allowed, then the turn restriction will contain at least the line before the not-allowed turning point and the line directly behind that point.

This methods checks whether at least one turn restriction exists which is completely part of the path in the argument of this method. It returns true if there is a turn restriction on that path.

Parameters:
path - the path to be checked for turn restrictions
Returns:
true, if there exists a turn restriction on that path, otherwise false

getAllNodes

Iterator<Node> getAllNodes()
Returns all nodes.

Returns:
all nodes

getAllLines

Iterator<Line> getAllLines()
Returns all lines.

Returns:
all lines

getMapBoundingBox

Rectangle2D.Double getMapBoundingBox()
Gets the bounding box of the map.

This method is optional and shall return null if not supported.

Returns:
the bounding box

getNumberOfNodes

int getNumberOfNodes()
Returns the number of nodes.

This method is optional and shall return -1 if not supported.

Returns:
the number of nodes

getNumberOfLines

int getNumberOfLines()
Returns the number of lines. *

This method is optional and shall return -1 if not supported.

Returns:
the number of lines


Copyright © 2013 TomTom International B.V.. All Rights Reserved.