1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.gpx;
|
---|
3 |
|
---|
4 | import java.util.Arrays;
|
---|
5 | import java.util.Collection;
|
---|
6 | import java.util.List;
|
---|
7 |
|
---|
8 | import org.openstreetmap.josm.Main;
|
---|
9 |
|
---|
10 | /**
|
---|
11 | * Constants for GPX handling.
|
---|
12 | */
|
---|
13 | public interface GpxConstants {
|
---|
14 |
|
---|
15 | /** GPS name of the element. This field will be transferred to and from the GPS.
|
---|
16 | * GPX does not place restrictions on the length of this field or the characters contained in it.
|
---|
17 | * It is up to the receiving application to validate the field before sending it to the GPS. */
|
---|
18 | public static final String GPX_NAME = "name";
|
---|
19 |
|
---|
20 | /** GPS element comment. Sent to GPS as comment. */
|
---|
21 | public static final String GPX_CMT = "cmt";
|
---|
22 |
|
---|
23 | /** Text description of the element. Holds additional information about the element intended for the user, not the GPS. */
|
---|
24 | public static final String GPX_DESC = "desc";
|
---|
25 |
|
---|
26 | /** Source of data. Included to give user some idea of reliability and accuracy of data. */
|
---|
27 | public static final String GPX_SRC = "src";
|
---|
28 |
|
---|
29 | public static final String META_PREFIX = "meta.";
|
---|
30 | public static final String META_AUTHOR_NAME = META_PREFIX + "author.name";
|
---|
31 | public static final String META_AUTHOR_EMAIL = META_PREFIX + "author.email";
|
---|
32 | public static final String META_AUTHOR_LINK = META_PREFIX + "author.link";
|
---|
33 | public static final String META_COPYRIGHT_AUTHOR = META_PREFIX + "copyright.author";
|
---|
34 | public static final String META_COPYRIGHT_LICENSE = META_PREFIX + "copyright.license";
|
---|
35 | public static final String META_COPYRIGHT_YEAR = META_PREFIX + "copyright.year";
|
---|
36 | public static final String META_DESC = META_PREFIX + "desc";
|
---|
37 | public static final String META_KEYWORDS = META_PREFIX + "keywords";
|
---|
38 | public static final String META_LINKS = META_PREFIX + "links";
|
---|
39 | public static final String META_NAME = META_PREFIX + "name";
|
---|
40 | public static final String META_TIME = META_PREFIX + "time";
|
---|
41 | public static final String META_BOUNDS = META_PREFIX + "bounds";
|
---|
42 | public static final String META_EXTENSIONS = META_PREFIX + "extensions";
|
---|
43 |
|
---|
44 | public static final String JOSM_EXTENSIONS_NAMESPACE_URI = Main.getXMLBase() + "/gpx-extensions-1.0";
|
---|
45 |
|
---|
46 | /** Elevation (in meters) of the point. */
|
---|
47 | public static final String PT_ELE = "ele";
|
---|
48 |
|
---|
49 | /** Creation/modification timestamp for the point.
|
---|
50 | * Date and time in are in Univeral Coordinated Time (UTC), not local time!
|
---|
51 | * Conforms to ISO 8601 specification for date/time representation.
|
---|
52 | * Fractional seconds are allowed for millisecond timing in tracklogs. */
|
---|
53 | public static final String PT_TIME = "time";
|
---|
54 |
|
---|
55 | /** Magnetic variation (in degrees) at the point. 0.0 <= value < 360.0 */
|
---|
56 | public static final String PT_MAGVAR = "magvar";
|
---|
57 |
|
---|
58 | /** Height, in meters, of geoid (mean sea level) above WGS-84 earth ellipsoid. (NMEA GGA message) */
|
---|
59 | public static final String PT_GEOIDHEIGHT = "geoidheight";
|
---|
60 |
|
---|
61 | /** Text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol on the GPS, if known. */
|
---|
62 | public static final String PT_SYM = "sym";
|
---|
63 |
|
---|
64 | /** Type (textual classification) of element. */
|
---|
65 | public static final String PT_TYPE = "type";
|
---|
66 |
|
---|
67 | /** Type of GPS fix. none means GPS had no fix. Value comes from list: {'none'|'2d'|'3d'|'dgps'|'pps'} */
|
---|
68 | public static final String PT_FIX = "fix";
|
---|
69 |
|
---|
70 | /** Number of satellites used to calculate the GPS fix. (not number of satellites in view). */
|
---|
71 | public static final String PT_SAT = "sat";
|
---|
72 |
|
---|
73 | /** Horizontal dilution of precision. */
|
---|
74 | public static final String PT_HDOP = "hdop";
|
---|
75 |
|
---|
76 | /** Vertical dilution of precision. */
|
---|
77 | public static final String PT_VDOP = "vdop";
|
---|
78 |
|
---|
79 | /** Position dilution of precision. */
|
---|
80 | public static final String PT_PDOP = "pdop";
|
---|
81 |
|
---|
82 | /** Number of seconds since last DGPS update. */
|
---|
83 | public static final String PT_AGEOFDGPSDATA = "ageofdgpsdata";
|
---|
84 |
|
---|
85 | /** Represents a differential GPS station. 0 <= value <= 1023 */
|
---|
86 | public static final String PT_DGPSID = "dgpsid";
|
---|
87 |
|
---|
88 | /**
|
---|
89 | * Ordered list of all possible waypoint keys.
|
---|
90 | */
|
---|
91 | public static List<String> WPT_KEYS = Arrays.asList(PT_ELE, PT_TIME, PT_MAGVAR, PT_GEOIDHEIGHT,
|
---|
92 | GPX_NAME, GPX_CMT, GPX_DESC, GPX_SRC, META_LINKS, PT_SYM, PT_TYPE,
|
---|
93 | PT_FIX, PT_SAT, PT_HDOP, PT_VDOP, PT_PDOP, PT_AGEOFDGPSDATA, PT_DGPSID, META_EXTENSIONS);
|
---|
94 |
|
---|
95 | /**
|
---|
96 | * Ordered list of all possible route and track keys.
|
---|
97 | */
|
---|
98 | public static List<String> RTE_TRK_KEYS = Arrays.asList(
|
---|
99 | GPX_NAME, GPX_CMT, GPX_DESC, GPX_SRC, META_LINKS, "number", PT_TYPE, META_EXTENSIONS);
|
---|
100 |
|
---|
101 | /**
|
---|
102 | * Possible fix values.
|
---|
103 | */
|
---|
104 | public static Collection<String> FIX_VALUES = Arrays.asList("none","2d","3d","dgps","pps");
|
---|
105 | }
|
---|