Class OSMNode

  • All Implemented Interfaces:
    java.io.Serializable

    public class OSMNode
    extends java.lang.Object
    implements java.io.Serializable
    OpenStreetmap Node.

    Copyright (c) 2013-2020 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 Detail

      • linksOriginating

        public int linksOriginating
        The number of OSMLinks originating at this OSMNode; i.e. having this node as start.
      • linksTerminating

        public int linksTerminating
        The number of OSMLinks ending at this OSMNode; i.e. having this node as end.
    • Constructor Detail

      • OSMNode

        public OSMNode​(long id,
                       double longitude,
                       double latitude)
        Construct a new OSMNode.
        Parameters:
        id - long; id of the new OSMNode
        longitude - double; longitude of the new OSMNode
        latitude - double; latitude of the new OSMNode
    • Method Detail

      • getId

        public final long getId()
        Returns:
        Id
      • getLongitude

        public final double getLongitude()
        Returns:
        longitude
      • getLatitude

        public final double getLatitude()
        Returns:
        latitude
      • getTag

        public final OSMTag getTag​(java.lang.String key)
        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

        public final void addTag​(OSMTag tag)
        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 class java.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

        public final void setOtsNode​(OTSRoadNode n)
        Parameters:
        n - OTSRoadNode; OTSRoadNode<String>
      • getOtsNode

        public final OTSRoadNode getOtsNode()
        Returns:
        OTSNodeOTSNode<String> - The associated OTS Node.
      • hasNoTags

        public final boolean hasNoTags()
        Returns:
        boolean; true if this OSMNode has no tags; false otherwise