Class WayPoint

    • Field Detail

      • customColoring

        public java.awt.Color customColoring
        The color to draw the segment before this point in
        See Also:
        drawLine
      • drawLine

        public boolean drawLine
        true indicates that the line before this point should be drawn
      • dir

        public int dir
        The direction of the line before this point. Used as cache to speed up drawing. Should not be relied on.
      • lat

        private final double lat
      • lon

        private final double lon
      • east

        private double east
      • north

        private double north
    • Constructor Detail

      • WayPoint

        public WayPoint​(WayPoint p)
        Constructs a new WayPoint from an existing one. Except for PT_TIME attribute, all attribute objects are shallow copied. This means modification of attr objects will affect original and new WayPoint.
        Parameters:
        p - existing waypoint
      • WayPoint

        public WayPoint​(LatLon ll)
        Constructs a new WayPoint from lat/lon coordinates.
        Parameters:
        ll - lat/lon coordinates
    • Method Detail

      • invalidateEastNorthCache

        public void invalidateEastNorthCache()
        Invalidate the internal cache of east/north coordinates.
      • getCoor

        public final LatLon getCoor()
        Returns the waypoint coordinates.
        Returns:
        the waypoint coordinates
      • 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
      • 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
      • getEastNorth

        public final EastNorth getEastNorth​(Projecting projecting)
        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:
        projecting - The projection to use.
        Returns:
        The projected east/north coordinates
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setTimeInMillis

        public void setTimeInMillis​(long ts)
        Sets the GpxConstants.PT_TIME attribute to the specified time.
        Parameters:
        ts - milliseconds from the epoch
        Since:
        14434
      • setInstant

        public void setInstant​(java.time.Instant instant)
        Sets the GpxConstants.PT_TIME attribute to the specified time.
        Parameters:
        instant - the time to set
      • getTime

        public double getTime()
        Returns the waypoint time in seconds since the epoch.
        Returns:
        the waypoint time
      • getTimeInMillis

        public long getTimeInMillis()
        Returns the waypoint time in milliseconds since the epoch.
        Returns:
        the waypoint time
        Since:
        14456
      • hasDate

        public boolean hasDate()
        Returns true if this waypoint has a time.
        Returns:
        true if a time is set, false otherwise
        Since:
        14456
      • getInstant

        public java.time.Instant getInstant()
        Returns the waypoint instant.
        Returns:
        the instant associated with this waypoint
        Since:
        14456
      • getTemplateValue

        public java.lang.Object getTemplateValue​(java.lang.String name,
                                                 boolean special)
        Description copied from interface: TemplateEngineDataProvider
        Map a key to a value given the properties of the object.
        Specified by:
        getTemplateValue in interface TemplateEngineDataProvider
        Parameters:
        name - the key to map
        special - if the key is a "special:*" keyword that is used to get certain information or automated behavior
        Returns:
        a value that the key is mapped to or "special" information in case special is true