Class OSMWay

  • All Implemented Interfaces:
    Serializable

    public class OSMWay
    extends Object
    implements Serializable
    OSMWay wraps an ordered set of OSMNode (identified by their ids) and a list of tags.

    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-07-26 01:01:13 +0200 (Sun, 26 Jul 2015) $, @version $Revision: 1155 $, by $Author: averbraeck $, initial version 31 dec. 2014

    Author:
    Moritz Bergmann
    See Also:
    Serialized Form
    • Constructor Detail

      • OSMWay

        public OSMWay​(long id)
        Construct a new OSMWay.
        Parameters:
        id - long; Id of the new OSMWay
    • Method Detail

      • getId

        public final long getId()
        Retrieve the dd of this OSMWay.
        Returns:
        long; the id of this OSMWay
      • getNodes

        public final List<Long> getNodes()
        Retrieve the list of ids that comprise this OSMWay.
        Returns:
        List<Long>; a list of ids of the nodes of this OSMWay DO NOT MODIFY THE RESUL.
      • setNodes

        public final void setNodes​(List<Long> newNodes)
        Set/replace the list of way nodes.
        Parameters:
        newNodes - List<Long>; the new list of way nodes
      • appendNode

        public final void appendNode​(Long nodeId)
        Append one node id to the list of node ids.
        Parameters:
        nodeId - Long; the id of the node that must be added
      • getTags

        public final List<OSMTag> getTags()
        Retrieve the list of OSMTags of this OSMWay.
        Returns:
        List<OSMTab>; the list of OSMTags of this OSMWay (modifications on this result are reflected in this OSMWay)
      • setTags

        public final void setTags​(List<OSMTag> newTags)
        Set/replace the list of way tags.
        Parameters:
        newTags - List<OSMTag>; the new list of way tags
      • addTag

        public final void addTag​(OSMTag waytag)
        Add one tag to the list of tags of this OSMWay.
        Parameters:
        waytag - OSMTag; the tag that must be added
      • getMatchingTags

        public final List<OSMTag> getMatchingTags​(String tagKey)
        Retrieve the tags that match the give key.
        Parameters:
        tagKey - String; the key
        Returns:
        List of matching Tags; the returned list is a copy; modifications of the result do not affect this OSMWay