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.ColorcustomColoringThe color to draw the segment before this point inintdirThe direction of the line before this point.booleandrawLinetrueindicates that the line before this point should be drawnprivate doubleeastprivate java.lang.ObjecteastNorthCacheKeyprivate doublelatprivate doublelonprivate doublenorth-
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_COURSE, 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 intcompareTo(WayPoint w)booleanequals(java.lang.Object obj)booleanevaluateCondition(SearchCompiler.Match condition)Check if a condition holds for the object represented by thisTemplateEngineDataProvider.LatLongetCoor()Returns the waypoint coordinates.EastNorthgetEastNorth(Projecting projecting)Replies the projected east/north coordinates.java.time.InstantgetInstant()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.ObjectgetTemplateValue(java.lang.String name, boolean special)Map a key to a value given the properties of the object.doublegetTime()Returns the waypoint time in seconds since the epoch.longgetTimeInMillis()Returns the waypoint time in milliseconds since the epoch.booleanhasDate()Returns true if this waypoint has a time.inthashCode()voidinvalidateEastNorthCache()Invalidate the internal cache of east/north coordinates.doublelat()Returns the latitude, i.e., the north-south position in degrees.doublelon()Returns the longitude, i.e., the east-west position in degrees.voidsetInstant(java.time.Instant instant)Sets theGpxConstants.PT_TIMEattribute to the specified time.voidsetTimeInMillis(long ts)Sets theGpxConstants.PT_TIMEattribute to the specified time.java.lang.StringtoString()-
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
trueindicates 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:ILatLonReturns the longitude, i.e., the east-west position in degrees.- Specified by:
lonin interfaceILatLon- Returns:
- the longitude or NaN if
ILatLon.isLatLonKnown()returns false
-
lat
public double lat()
Description copied from interface:ILatLonReturns the latitude, i.e., the north-south position in degrees.- Specified by:
latin interfaceILatLon- Returns:
- the latitude or NaN if
ILatLon.isLatLonKnown()returns false
-
getEastNorth
public final EastNorth getEastNorth(Projecting projecting)
Description copied from interface:ILatLonReplies 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:
getEastNorthin interfaceILatLon- Parameters:
projecting- The projection to use.- Returns:
- The projected east/north coordinates
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setTimeInMillis
public void setTimeInMillis(long ts)
Sets theGpxConstants.PT_TIMEattribute to the specified time.- Parameters:
ts- milliseconds from the epoch- Since:
- 14434
-
setInstant
public void setInstant(java.time.Instant instant)
Sets theGpxConstants.PT_TIMEattribute to the specified time.- Parameters:
instant- the time to set
-
compareTo
public int compareTo(WayPoint w)
- Specified by:
compareToin 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:TemplateEngineDataProviderMap a key to a value given the properties of the object.- Specified by:
getTemplateValuein 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
specialis true
-
evaluateCondition
public boolean evaluateCondition(SearchCompiler.Match condition)
Description copied from interface:TemplateEngineDataProviderCheck if a condition holds for the object represented by thisTemplateEngineDataProvider.- Specified by:
evaluateConditionin 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:TemplateEngineDataProviderGet the collection of all keys that can be mapped to values.- Specified by:
getTemplateKeysin interfaceTemplateEngineDataProvider- Returns:
- all keys that can be mapped to values
-
hashCode
public int hashCode()
- Overrides:
hashCodein classWithAttributes
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classWithAttributes
-
-