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