openlr.map
Interface Line


public interface Line

The Interface Line is a one-dimensional representation of a road or part of road in a road network. A line starts and ends at a node. It is directed, this means two-way traffic flow is represented by two (directed) lines, one per direction. A line is not abstracted by the airline between start and end node, it rather "knows" its geometry. Additional information on that line includes its functional road class and its form of way. Since the line is part of a network, its predecessors and successors are also accessible if available.

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

email: software@openlr.org

Author:
TomTom International B.V.

Method Summary
 int distanceToPoint(double longitude, double latitude)
          Calculates the (smallest) distance in meters between the line and the point given by its longitude and latitude coordinates.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 Node getEndNode()
          Gets the end node of the line.
 FormOfWay getFOW()
          Gets the FormOfWay of the line.
 FunctionalRoadClass getFRC()
          Gets the FunctionalRoadClass of the line.
 GeoCoordinates getGeoCoordinateAlongLine(int distanceAlong)
          Gets a point along the line geometry which is distanceAlong meter away from the start node of the line.
 long getID()
          Gets the unique ID.
 int getLineLength()
          Gets the length of the line indicating its real dimension along the geometry of the line.
 Map<Locale,List<String>> getNames()
          Gets the names of the line.
 Iterator<Line> getNextLines()
          Returns a set of lines which follows this line in the same direction.
 Point2D.Double getPointAlongLine(int distanceAlong)
          Deprecated. This method still exists to keep backwards compatibility and will be removed in future releases, use getGeoCoordinateAlongLine(int) instead.
 Iterator<Line> getPrevLines()
          Returns a set of lines which precedes this line in the same direction.
 Path2D.Double getShape()
          Deprecated. This method still exists to keep backwards compatibility and will be removed in future releases, use getShapeCoordinates() instead.
 List<GeoCoordinates> getShapeCoordinates()
          Gets the shape of the line.
 Node getStartNode()
          Gets the start node of the line.
 int hashCode()
          Returns a hash code value for the line.
 int measureAlongLine(double longitude, double latitude)
          Calculates a projection point on the line for the given coordinates and returns the distance between the start node of the line and the projection point along the line shape.
 

Method Detail

getStartNode

Node getStartNode()
Gets the start node of the line.

Returns:
the start node

getEndNode

Node getEndNode()
Gets the end node of the line.

Returns:
the end node

getFOW

FormOfWay getFOW()
Gets the FormOfWay of the line.

Returns:
the form of way

getFRC

FunctionalRoadClass getFRC()
Gets the FunctionalRoadClass of the line.

Returns:
the functional road class

getPointAlongLine

@Deprecated
Point2D.Double getPointAlongLine(int distanceAlong)
Deprecated. This method still exists to keep backwards compatibility and will be removed in future releases, use getGeoCoordinateAlongLine(int) instead.

Gets a point along the line geometry which is distanceAlong meter away from the start node of the line. If the given distance exceeds the length of the line the end node is returned! The x-coordinate of the point refers to the longitude value and the y-coordinate refers to the latitude value.

Parameters:
distanceAlong - the distance along the geometry of the line to find the position
Returns:
the point on the line being distanceAlong meters away from the start node

getGeoCoordinateAlongLine

GeoCoordinates getGeoCoordinateAlongLine(int distanceAlong)
Gets a point along the line geometry which is distanceAlong meter away from the start node of the line. If the given distance exceeds the length of the line the end node is returned! The x-coordinate of the point refers to the longitude value and the y-coordinate refers to the latitude value.

Parameters:
distanceAlong - the distance along the geometry of the line to find the position
Returns:
the point on the line being distanceAlong meters away from the start node

getLineLength

int getLineLength()
Gets the length of the line indicating its real dimension along the geometry of the line. The resolution used for the length value should be meter [m].

Returns:
the length of the line in meter

getID

long getID()
Gets the unique ID.

Returns:
the unique ID

getPrevLines

Iterator<Line> getPrevLines()
Returns a set of lines which precedes this line in the same direction. The set of lines is equal to the set of incoming lines of the start node of this line.

Returns:
a set of lines preceding this line in the same direction

getNextLines

Iterator<Line> getNextLines()
Returns a set of lines which follows this line in the same direction. The set of lines is equal to the set of outgoing lines of the end node of this line.

Returns:
a set of lines following this line in the same direction

equals

boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare
Returns:
true, if this object is the same as the obj argument, otherwise false

hashCode

int hashCode()
Returns a hash code value for the line.

Overrides:
hashCode in class Object
Returns:
a hash code value for the line

distanceToPoint

int distanceToPoint(double longitude,
                    double latitude)
Calculates the (smallest) distance in meters between the line and the point given by its longitude and latitude coordinates.

Parameters:
longitude - the longitude coordinate of the point
latitude - the latitude coordinate of the point
Returns:
the (smallest) distance between the line and the point

measureAlongLine

int measureAlongLine(double longitude,
                     double latitude)
Calculates a projection point on the line for the given coordinates and returns the distance between the start node of the line and the projection point along the line shape. The projection point shall be that point on the line with the smallest distance between the line and the point given by the longitude and latitude coordinates.

Parameters:
longitude - the longitude coordinate of the point
latitude - the latitude coordinate of the point
Returns:
the distance between the start node and the projection of the point given by the coordinates

getShape

@Deprecated
Path2D.Double getShape()
Deprecated. This method still exists to keep backwards compatibility and will be removed in future releases, use getShapeCoordinates() instead.

Gets the shape of the line.

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

Returns:
the shape of the line

getShapeCoordinates

List<GeoCoordinates> getShapeCoordinates()
Gets the shape of the line.

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

Returns:
the shape of the line

getNames

Map<Locale,List<String>> getNames()
Gets the names of the line. The map addresses all available locale settings and the most common name for this line should come first in the list of name strings.

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

Returns:
the names of the line


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