001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.gpx; 003 004import java.util.Arrays; 005import java.util.Collection; 006import java.util.List; 007 008import org.openstreetmap.josm.Main; 009 010/** 011 * Constants for GPX handling. 012 */ 013public interface GpxConstants { 014 015 /** GPS name of the element. This field will be transferred to and from the GPS. 016 * GPX does not place restrictions on the length of this field or the characters contained in it. 017 * It is up to the receiving application to validate the field before sending it to the GPS. */ 018 public static final String GPX_NAME = "name"; 019 020 /** GPS element comment. Sent to GPS as comment. */ 021 public static final String GPX_CMT = "cmt"; 022 023 /** Text description of the element. Holds additional information about the element intended for the user, not the GPS. */ 024 public static final String GPX_DESC = "desc"; 025 026 /** Source of data. Included to give user some idea of reliability and accuracy of data. */ 027 public static final String GPX_SRC = "src"; 028 029 public static final String META_PREFIX = "meta."; 030 public static final String META_AUTHOR_NAME = META_PREFIX + "author.name"; 031 public static final String META_AUTHOR_EMAIL = META_PREFIX + "author.email"; 032 public static final String META_AUTHOR_LINK = META_PREFIX + "author.link"; 033 public static final String META_COPYRIGHT_AUTHOR = META_PREFIX + "copyright.author"; 034 public static final String META_COPYRIGHT_LICENSE = META_PREFIX + "copyright.license"; 035 public static final String META_COPYRIGHT_YEAR = META_PREFIX + "copyright.year"; 036 public static final String META_DESC = META_PREFIX + "desc"; 037 public static final String META_KEYWORDS = META_PREFIX + "keywords"; 038 public static final String META_LINKS = META_PREFIX + "links"; 039 public static final String META_NAME = META_PREFIX + "name"; 040 public static final String META_TIME = META_PREFIX + "time"; 041 public static final String META_BOUNDS = META_PREFIX + "bounds"; 042 public static final String META_EXTENSIONS = META_PREFIX + "extensions"; 043 044 public static final String JOSM_EXTENSIONS_NAMESPACE_URI = Main.getXMLBase() + "/gpx-extensions-1.0"; 045 046 /** Elevation (in meters) of the point. */ 047 public static final String PT_ELE = "ele"; 048 049 /** Creation/modification timestamp for the point. 050 * Date and time in are in Univeral Coordinated Time (UTC), not local time! 051 * Conforms to ISO 8601 specification for date/time representation. 052 * Fractional seconds are allowed for millisecond timing in tracklogs. */ 053 public static final String PT_TIME = "time"; 054 055 /** Magnetic variation (in degrees) at the point. 0.0 <= value < 360.0 */ 056 public static final String PT_MAGVAR = "magvar"; 057 058 /** Height, in meters, of geoid (mean sea level) above WGS-84 earth ellipsoid. (NMEA GGA message) */ 059 public static final String PT_GEOIDHEIGHT = "geoidheight"; 060 061 /** Text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol on the GPS, if known. */ 062 public static final String PT_SYM = "sym"; 063 064 /** Type (textual classification) of element. */ 065 public static final String PT_TYPE = "type"; 066 067 /** Type of GPS fix. none means GPS had no fix. Value comes from list: {'none'|'2d'|'3d'|'dgps'|'pps'} */ 068 public static final String PT_FIX = "fix"; 069 070 /** Number of satellites used to calculate the GPS fix. (not number of satellites in view). */ 071 public static final String PT_SAT = "sat"; 072 073 /** Horizontal dilution of precision. */ 074 public static final String PT_HDOP = "hdop"; 075 076 /** Vertical dilution of precision. */ 077 public static final String PT_VDOP = "vdop"; 078 079 /** Position dilution of precision. */ 080 public static final String PT_PDOP = "pdop"; 081 082 /** Number of seconds since last DGPS update. */ 083 public static final String PT_AGEOFDGPSDATA = "ageofdgpsdata"; 084 085 /** Represents a differential GPS station. 0 <= value <= 1023 */ 086 public static final String PT_DGPSID = "dgpsid"; 087 088 /** 089 * Ordered list of all possible waypoint keys. 090 */ 091 public static List<String> WPT_KEYS = Arrays.asList(PT_ELE, PT_TIME, PT_MAGVAR, PT_GEOIDHEIGHT, 092 GPX_NAME, GPX_CMT, GPX_DESC, GPX_SRC, META_LINKS, PT_SYM, PT_TYPE, 093 PT_FIX, PT_SAT, PT_HDOP, PT_VDOP, PT_PDOP, PT_AGEOFDGPSDATA, PT_DGPSID, META_EXTENSIONS); 094 095 /** 096 * Ordered list of all possible route and track keys. 097 */ 098 public static List<String> RTE_TRK_KEYS = Arrays.asList( 099 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}