Package org.openstreetmap.josm.data.gpx
Class WayPoint
- java.lang.Object
-
- org.openstreetmap.josm.data.gpx.WithAttributes
-
- org.openstreetmap.josm.data.gpx.WayPoint
-
- All Implemented Interfaces:
java.lang.Comparable<WayPoint>
,ILatLon
,GpxConstants
,IWithAttributes
,TemplateEngineDataProvider
public class WayPoint extends WithAttributes implements java.lang.Comparable<WayPoint>, TemplateEngineDataProvider, ILatLon
A point in the GPX data- Since:
- 12167 implements ILatLon
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.data.gpx.GpxConstants
GpxConstants.ColorFormat
-
-
Field Summary
Fields Modifier and Type Field Description java.awt.Color
customColoring
The color to draw the segment before this point inint
dir
The direction of the line before this point.boolean
drawLine
true
indicates that the line before this point should be drawnprivate double
east
private java.lang.Object
eastNorthCacheKey
private double
lat
private double
lon
private double
north
-
Fields inherited from class org.openstreetmap.josm.data.gpx.WithAttributes
attr
-
Fields inherited from interface org.openstreetmap.josm.data.gpx.GpxConstants
EXTENSION_ABBREVIATIONS, FIX_VALUES, GARMIN_COLORS, GPX_CMT, GPX_DESC, GPX_NAME, GPX_PREFIX, GPX_SRC, JOSM_CREATOR_NAME, META_AUTHOR_EMAIL, META_AUTHOR_LINK, META_AUTHOR_NAME, META_BOUNDS, META_COPYRIGHT_AUTHOR, META_COPYRIGHT_LICENSE, META_COPYRIGHT_YEAR, META_DESC, META_KEYWORDS, META_LINKS, META_NAME, META_PREFIX, META_TIME, PT_AGEOFDGPSDATA, PT_DGPSID, PT_ELE, PT_FIX, PT_GEOIDHEIGHT, PT_HDOP, PT_MAGVAR, PT_PDOP, PT_SAT, PT_STD_HDEV, PT_STD_VDEV, PT_SYM, PT_TIME, PT_TYPE, PT_VDOP, RTE_TRK_KEYS, RTKLIB_AGE, RTKLIB_Q, RTKLIB_RATIO, RTKLIB_SDE, RTKLIB_SDEU, RTKLIB_SDN, RTKLIB_SDNE, RTKLIB_SDU, RTKLIB_SDUN, WPT_KEYS, XML_URI_EXTENSIONS_DRAWING, XML_URI_EXTENSIONS_GARMIN, XML_URI_EXTENSIONS_JOSM, XML_URI_XSD, XML_XSD_EXTENSIONS_DRAWING, XML_XSD_EXTENSIONS_GARMIN, XML_XSD_EXTENSIONS_JOSM
-
Fields inherited from interface org.openstreetmap.josm.data.coor.ILatLon
MAX_SERVER_PRECISION
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(WayPoint w)
boolean
equals(java.lang.Object obj)
boolean
evaluateCondition(SearchCompiler.Match condition)
Check if a condition holds for the object represented by thisTemplateEngineDataProvider
.LatLon
getCoor()
Returns the waypoint coordinates.EastNorth
getEastNorth(Projecting projecting)
Replies the projected east/north coordinates.java.time.Instant
getInstant()
Returns the waypoint instant.java.util.List<java.lang.String>
getTemplateKeys()
Get the collection of all keys that can be mapped to values.java.lang.Object
getTemplateValue(java.lang.String name, boolean special)
Map a key to a value given the properties of the object.double
getTime()
Returns the waypoint time in seconds since the epoch.long
getTimeInMillis()
Returns the waypoint time in milliseconds since the epoch.boolean
hasDate()
Returns true if this waypoint has a time.int
hashCode()
void
invalidateEastNorthCache()
Invalidate the internal cache of east/north coordinates.double
lat()
Returns the latitude, i.e., the north-south position in degrees.double
lon()
Returns the longitude, i.e., the east-west position in degrees.void
setInstant(java.time.Instant instant)
Sets theGpxConstants.PT_TIME
attribute to the specified time.void
setTimeInMillis(long ts)
Sets theGpxConstants.PT_TIME
attribute to the specified time.java.lang.String
toString()
-
Methods inherited from class org.openstreetmap.josm.data.gpx.WithAttributes
get, getAttributes, getCollection, getExtensions, getString, hasExtensions, put
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.coor.ILatLon
bearing, distanceSq, distanceSq, equalsEpsilon, equalsEpsilon, greatCircleDistance, interpolate, isLatLonKnown
-
-
-
-
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
-
eastNorthCacheKey
private java.lang.Object eastNorthCacheKey
-
-
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 interfaceILatLon
- 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 interfaceILatLon
- 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 interfaceILatLon
- Parameters:
projecting
- The projection to use.- Returns:
- The projected east/north coordinates
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setTimeInMillis
public void setTimeInMillis(long ts)
Sets theGpxConstants.PT_TIME
attribute to the specified time.- Parameters:
ts
- milliseconds from the epoch- Since:
- 14434
-
setInstant
public void setInstant(java.time.Instant instant)
Sets theGpxConstants.PT_TIME
attribute to the specified time.- Parameters:
instant
- the time to set
-
compareTo
public int compareTo(WayPoint w)
- Specified by:
compareTo
in interfacejava.lang.Comparable<WayPoint>
-
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 interfaceTemplateEngineDataProvider
- Parameters:
name
- the key to mapspecial
- 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
-
evaluateCondition
public boolean evaluateCondition(SearchCompiler.Match condition)
Description copied from interface:TemplateEngineDataProvider
Check if a condition holds for the object represented by thisTemplateEngineDataProvider
.- Specified by:
evaluateCondition
in interfaceTemplateEngineDataProvider
- Parameters:
condition
- the condition to check (which is a search expression)- Returns:
- true if the condition holds
-
getTemplateKeys
public java.util.List<java.lang.String> getTemplateKeys()
Description copied from interface:TemplateEngineDataProvider
Get the collection of all keys that can be mapped to values.- Specified by:
getTemplateKeys
in interfaceTemplateEngineDataProvider
- Returns:
- all keys that can be mapped to values
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classWithAttributes
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classWithAttributes
-
-