Class Node

    • Constructor Detail

      • Node

        Node​(long id,
             boolean allowNegative)
      • Node

        public Node()
        Constructs a new local Node with id 0.
      • Node

        public Node​(long id)
        Constructs an incomplete Node object with the given id.
        Parameters:
        id - The id. Must be >= 0
        Throws:
        IllegalArgumentException - if id < 0
      • Node

        public Node​(long id,
                    int version)
        Constructs a new Node with the given id and version.
        Parameters:
        id - The id. Must be >= 0
        version - The version
        Throws:
        IllegalArgumentException - if id < 0
      • Node

        public Node​(Node clone,
                    boolean clearMetadata)
        Constructs an identical clone of the argument.
        Parameters:
        clone - The node to clone
        clearMetadata - If true, clears the OSM id and other metadata as defined by OsmPrimitive.clearOsmMetadata(). If false, does nothing
      • Node

        public Node​(Node clone)
        Constructs an identical clone of the argument (including the id).
        Parameters:
        clone - The node to clone, including its id
      • Node

        public Node​(LatLon latlon)
        Constructs a new Node with the given lat/lon with id 0.
        Parameters:
        latlon - The LatLon coordinates
      • Node

        public Node​(EastNorth eastNorth)
        Constructs a new Node with the given east/north with id 0.
        Parameters:
        eastNorth - The EastNorth coordinates
    • Method Detail

      • setCoor

        public void setCoor​(LatLon coor)
        Description copied from interface: INode
        Sets lat/lon coordinates of this node.
        Specified by:
        setCoor in interface INode
        Parameters:
        coor - lat/lon coordinates of this node
      • setEastNorth

        public void setEastNorth​(EastNorth eastNorth)
        Description copied from interface: INode
        Sets east/north coordinates of this node.
        Specified by:
        setEastNorth in interface INode
        Parameters:
        eastNorth - east/north coordinates of this node
      • lat

        public double lat()
        Description copied from interface: ILatLon
        Returns the latitude, i.e., the north-south position in degrees.
        Specified by:
        lat in interface ILatLon
        Returns:
        the latitude or NaN if ILatLon.isLatLonKnown() returns false
      • lon

        public double lon()
        Description copied from interface: ILatLon
        Returns the longitude, i.e., the east-west position in degrees.
        Specified by:
        lon in interface ILatLon
        Returns:
        the longitude or NaN if ILatLon.isLatLonKnown() returns false
      • getEastNorth

        public EastNorth getEastNorth​(Projecting projection)
        Description copied from interface: ILatLon
        Replies the projected east/north coordinates.

        The result of the last conversion may be cached. Null is returned in case this object is invalid.

        Specified by:
        getEastNorth in interface ILatLon
        Parameters:
        projection - The projection to use.
        Returns:
        The projected east/north coordinates
      • setCoorInternal

        void setCoorInternal​(LatLon coor,
                             EastNorth eastNorth)
        To be used only by Dataset.reindexNode
        Parameters:
        coor - lat/lon
        eastNorth - east/north
      • setDataset

        void setDataset​(DataSet dataSet)
        Description copied from class: OsmPrimitive
        This method should never ever by called from somewhere else than Dataset.addPrimitive or removePrimitive methods
        Overrides:
        setDataset in class OsmPrimitive
        Parameters:
        dataSet - the parent dataset
      • accept

        public void accept​(OsmPrimitiveVisitor visitor)
        Description copied from class: OsmPrimitive
        Implementation of the visitor scheme. Subclasses have to call the correct visitor function.
        Specified by:
        accept in class OsmPrimitive
        Parameters:
        visitor - The visitor from which the visit() function must be called.
      • cloneFrom

        public void cloneFrom​(OsmPrimitive osm,
                              boolean copyChildren)
        Description copied from class: OsmPrimitive
        Get and write all attributes from the parameter. Does not fire any listener, so use this only in the data initializing phase
        Overrides:
        cloneFrom in class OsmPrimitive
        Parameters:
        osm - other primitive
        copyChildren - whether to copy child primitives too
      • load

        public void load​(PrimitiveData data)
        Description copied from class: OsmPrimitive
        Loads (clone) this primitive from provided PrimitiveData
        Overrides:
        load in class OsmPrimitive
        Parameters:
        data - The object which should be cloned
      • save

        public NodeData save()
        Description copied from class: OsmPrimitive
        Save parameters of this primitive to the transport object
        Specified by:
        save in class OsmPrimitive
        Returns:
        The saved object data
      • addToBBox

        protected void addToBBox​(BBox box,
                                 Set<PrimitiveId> visited)
        Description copied from class: OsmPrimitive
        If necessary, extend the bbox to contain this primitive
        Specified by:
        addToBBox in class OsmPrimitive
        Parameters:
        box - a bbox instance
        visited - a set of visited members or null
      • isDrawable

        public boolean isDrawable()
        Description copied from interface: IPrimitive
        Determines if this object is drawable.

        A primitive is drawable if all conditions are met:

        • type and id is known
        • tags are known
        • it is not deleted
        • it is not hidden by a filter
        • for nodes: lat/lon are known
        • for ways: all nodes are known and complete
        • for relations: all members are known and complete
        Specified by:
        isDrawable in interface IPrimitive
        Overrides:
        isDrawable in class OsmPrimitive
        Returns:
        true if this object is drawable
      • isReferredByWays

        public boolean isReferredByWays​(int n)
        Description copied from interface: INode
        Return true, if this primitive is referred by at least n ways
        Specified by:
        isReferredByWays in interface INode
        Parameters:
        n - Minimal number of ways to return true. Must be positive
        Returns:
        true if this primitive is referred by at least n ways
      • invalidateEastNorthCache

        public void invalidateEastNorthCache()
        Invoke to invalidate the internal cache of projected east/north coordinates. Coordinates are reprojected on demand when the INode.getEastNorth() is invoked next time.
      • concernsArea

        public boolean concernsArea()
        Description copied from class: OsmPrimitive
        Determines if this primitive semantically concerns an area.
        Specified by:
        concernsArea in class OsmPrimitive
        Returns:
        true if this primitive semantically concerns an area, according to its type, geometry and tags, false otherwise.
      • getParentWays

        public List<WaygetParentWays()
        Replies the set of referring ways.
        Returns:
        the set of referring ways
        Since:
        12031
      • isOutSideWorld

        public boolean isOutSideWorld()
        Determines if this node is outside of the world. See also #13538.
        Returns:
        true, if the coordinate is outside the world, compared by using lat/lon and east/north
        Since:
        14960