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:
Comparable<WayPoint>,ILatLon,GpxConstants,IWithAttributes,TemplateEngineDataProvider
public class WayPoint
extends WithAttributes
implements 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
FieldsModifier and TypeFieldDescriptionThe color to draw the segment before this point inintThe direction of the line before this point.booleantrueindicates that the line before this point should be drawnprivate doubleprivate Objectprivate final doubleprivate final doubleprivate doubleFields inherited from class org.openstreetmap.josm.data.gpx.WithAttributes
attrFields 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_JOSMFields inherited from interface org.openstreetmap.josm.data.coor.ILatLon
MAX_SERVER_PRECISION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanbooleanevaluateCondition(SearchCompiler.Match condition) Check if a condition holds for the object represented by thisTemplateEngineDataProvider.final LatLongetCoor()Returns the waypoint coordinates.final EastNorthgetEastNorth(Projecting projecting) Replies the projected east/north coordinates.Returns the waypoint instant.Get the collection of all keys that can be mapped to values.getTemplateValue(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.longReturns the waypoint time in milliseconds since the epoch.booleanhasDate()Returns true if this waypoint has a time.inthashCode()voidInvalidate 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(Instant instant) Sets theGpxConstants.PT_TIMEattribute to the specified time.voidsetTimeInMillis(long ts) Sets theGpxConstants.PT_TIMEattribute to the specified time.toString()Methods inherited from class org.openstreetmap.josm.data.gpx.WithAttributes
get, getAttributes, getCollection, getExtensions, getString, hasExtensions, putMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.data.coor.ILatLon
bearing, distanceSq, distanceSq, equalsEpsilon, equalsEpsilon, greatCircleDistance, interpolate, isLatLonKnown
-
Field Details
-
customColoring
The color to draw the segment before this point in- See Also:
-
drawLine
trueindicates that the line before this point should be drawn -
dir
The direction of the line before this point. Used as cache to speed up drawing. Should not be relied on. -
lat
-
lon
-
east
-
north
-
eastNorthCacheKey
-
-
Constructor Details
-
WayPoint
Constructs a newWayPointfrom an existing one. Except for PT_TIME attribute, all attribute objects are shallow copied. This means modification of attr objects will affect original and newWayPoint.- Parameters:
p- existing waypoint
-
WayPoint
Constructs a newWayPointfrom lat/lon coordinates.- Parameters:
ll- lat/lon coordinates
-
-
Method Details
-
invalidateEastNorthCache
Invalidate the internal cache of east/north coordinates. -
getCoor
Returns the waypoint coordinates.- Returns:
- the waypoint coordinates
-
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
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
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
-
setTimeInMillis
Sets theGpxConstants.PT_TIMEattribute to the specified time.- Parameters:
ts- milliseconds from the epoch- Since:
- 14434
-
setInstant
Sets theGpxConstants.PT_TIMEattribute to the specified time.- Parameters:
instant- the time to set
-
compareTo
- Specified by:
compareToin interfaceComparable<WayPoint>
-
getTime
Returns the waypoint time in seconds since the epoch.- Returns:
- the waypoint time
-
getTimeInMillis
Returns the waypoint time in milliseconds since the epoch.- Returns:
- the waypoint time
- Since:
- 14456
-
hasDate
Returns true if this waypoint has a time.- Returns:
- true if a time is set, false otherwise
- Since:
- 14456
-
getInstant
Returns the waypoint instant.- Returns:
- the instant associated with this waypoint
- Since:
- 14456
-
getTemplateValue
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
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
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
- Overrides:
hashCodein classWithAttributes
-
equals
- Overrides:
equalsin classWithAttributes
-