Class OSMNode
java.lang.Object
org.opentrafficsim.road.network.factory.osm.OSMNode
- All Implemented Interfaces:
java.io.Serializable
public class OSMNode
extends java.lang.Object
implements java.io.Serializable
OpenStreetmap Node.
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-08-23 00:48:01 +0200 (Sun, 23 Aug 2015) $, @version $Revision: 1291 $, by $Author: averbraeck $,
initial version 31 dec. 2014
- Author:
- Moritz Bergmann
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description int
linksOriginating
The number of OSMLinks originating at this OSMNode; i.e.int
linksTerminating
The number of OSMLinks ending at this OSMNode; i.e. -
Constructor Summary
Constructors Constructor Description OSMNode(long id, double longitude, double latitude)
Construct a new OSMNode. -
Method Summary
Modifier and Type Method Description void
addTag(OSMTag tag)
Add a tag to this OSMNode.long
getId()
double
getLatitude()
double
getLongitude()
OTSRoadNode
getOtsNode()
OSMTag
getTag(java.lang.String key)
Retrieve a tag of this OSMNode.boolean
hasNoTags()
boolean
isCrossing()
boolean
isStopSign()
boolean
isTrafficSignal()
boolean
isYieldSign()
void
setCrossing(boolean crossing)
void
setOtsNode(OTSRoadNode n)
void
setStopSign(boolean stopSign)
void
setTrafficSignal(boolean trafficSignal)
void
setYieldSign(boolean yieldSign)
java.lang.String
toString()
-
Field Details
-
linksOriginating
public int linksOriginatingThe number of OSMLinks originating at this OSMNode; i.e. having this node as start. -
linksTerminating
public int linksTerminatingThe number of OSMLinks ending at this OSMNode; i.e. having this node as end.
-
-
Constructor Details
-
OSMNode
public OSMNode(long id, double longitude, double latitude)Construct a new OSMNode.- Parameters:
id
- long; id of the new OSMNodelongitude
- double; longitude of the new OSMNodelatitude
- double; latitude of the new OSMNode
-
-
Method Details
-
getId
public final long getId()- Returns:
- Id
-
getLongitude
public final double getLongitude()- Returns:
- longitude
-
getLatitude
public final double getLatitude()- Returns:
- latitude
-
getTag
Retrieve a tag of this OSMNode.- Parameters:
key
- String; the key of the tag to retrieve- Returns:
- OSMTag, or null if this OSMNode has no tag with the specified key
-
addTag
Add a tag to this OSMNode.- Parameters:
tag
- OSMTag; the tag to add to this OSMNode
-
toString
public final java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
isTrafficSignal
public final boolean isTrafficSignal()- Returns:
- trafficSignal.
-
setTrafficSignal
public final void setTrafficSignal(boolean trafficSignal)- Parameters:
trafficSignal
- boolean; set trafficSignal.
-
isStopSign
public final boolean isStopSign()- Returns:
- stopSign.
-
setStopSign
public final void setStopSign(boolean stopSign)- Parameters:
stopSign
- boolean; set stopSign.
-
isYieldSign
public final boolean isYieldSign()- Returns:
- yieldSign.
-
setYieldSign
public final void setYieldSign(boolean yieldSign)- Parameters:
yieldSign
- boolean; set yieldSign.
-
isCrossing
public final boolean isCrossing()- Returns:
- crossing.
-
setCrossing
public final void setCrossing(boolean crossing)- Parameters:
crossing
- boolean; set crossing.
-
setOtsNode
- Parameters:
n
- OTSRoadNode; OTSRoadNode<String>
-
getOtsNode
- Returns:
- OTSNodeOTSNode<String> - The associated OTS Node.
-
hasNoTags
public final boolean hasNoTags()- Returns:
- boolean; true if this OSMNode has no tags; false otherwise
-