Package org.openstreetmap.josm.tools
Class RightAndLefthandTraffic
- java.lang.Object
-
- org.openstreetmap.josm.tools.RightAndLefthandTraffic
-
public final class RightAndLefthandTraffic extends java.lang.Object
Look up, if there is right- or left-hand traffic at a certain place. See Left- and right-hand traffic
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DRIVING_SIDE
private static java.lang.String
LEFT
private static java.lang.String
RIGHT
private static GeoPropertyIndex<java.lang.Boolean>
rlCache
-
Constructor Summary
Constructors Modifier Constructor Description private
RightAndLefthandTraffic()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
addWayIfNotInner(java.util.Collection<Way> ways, Way w)
Adds w to ways, except if it is an inner way of another lefthand driving multipolygon, as Lesotho in South Africa and Cyprus village in British Cyprus base.(package private) static void
appendLeftDrivingBoundaries(OsmPrimitive osm, java.util.Collection<Way> ways)
(package private) static void
initialize(DefaultGeoProperty geoProperty)
Initializes Right and lefthand traffic data.static boolean
isRightHandTraffic(LatLon ll)
Check if there is right-hand traffic at a certain location.
-
-
-
Field Detail
-
DRIVING_SIDE
private static final java.lang.String DRIVING_SIDE
- See Also:
- Constant Field Values
-
LEFT
private static final java.lang.String LEFT
- See Also:
- Constant Field Values
-
RIGHT
private static final java.lang.String RIGHT
- See Also:
- Constant Field Values
-
rlCache
private static volatile GeoPropertyIndex<java.lang.Boolean> rlCache
-
-
Constructor Detail
-
RightAndLefthandTraffic
private RightAndLefthandTraffic()
-
-
Method Detail
-
isRightHandTraffic
public static boolean isRightHandTraffic(LatLon ll)
Check if there is right-hand traffic at a certain location.- Parameters:
ll
- the coordinates of the point- Returns:
- true if there is right-hand traffic, false if there is left-hand traffic
-
initialize
static void initialize(DefaultGeoProperty geoProperty)
Initializes Right and lefthand traffic data.- Parameters:
geoProperty
- the property containing the traffic data TODO: Synchronization can be refined inside theGeoPropertyIndex
as most look-ups are read-only.
-
appendLeftDrivingBoundaries
static void appendLeftDrivingBoundaries(OsmPrimitive osm, java.util.Collection<Way> ways)
-
addWayIfNotInner
private static void addWayIfNotInner(java.util.Collection<Way> ways, Way w)
Adds w to ways, except if it is an inner way of another lefthand driving multipolygon, as Lesotho in South Africa and Cyprus village in British Cyprus base.- Parameters:
ways
- waysw
- way
-
-