1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-28 03:25:49 +01:00

Adds GPX schema XSD, sample data, and tests which validate output.

This commit is contained in:
Nick Spacek 2019-03-16 11:13:27 -03:00
parent ccafda7f00
commit 6854807f91
4 changed files with 936 additions and 0 deletions

View File

@ -0,0 +1,124 @@
package nodomain.freeyourgadget.gadgetbridge.export;
import com.google.gson.internal.bind.util.ISO8601Utils;
import org.junit.Test;
import org.xml.sax.SAXException;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.text.ParsePosition;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.xml.XMLConstants;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.entities.User;
import nodomain.freeyourgadget.gadgetbridge.export.ActivityTrackExporter.GPXTrackEmptyException;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityPoint;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityTrack;
import nodomain.freeyourgadget.gadgetbridge.model.GPSCoordinate;
import nodomain.freeyourgadget.gadgetbridge.test.TestBase;
public class GPXExporterTest extends TestBase {
@Test
public void shouldCreateValidGpxFromSimulatedData() throws IOException, ParseException, GPXTrackEmptyException, SAXException {
final List<ActivityPoint> points = readActivityPoints("/GPXExporterTest-SampleTracks.csv");
final GPXExporter gpxExporter = new GPXExporter();
gpxExporter.setCreator("Gadgetbridge Test");
final ActivityTrack track = createTestTrack(points);
final File tempFile = File.createTempFile("gpx-exporter-test-track", ".gpx");
tempFile.deleteOnExit();
gpxExporter.performExport(track, tempFile);
validateGpxFile(tempFile);
}
@Test
public void shouldCreateValidGpxFromSimulatedDataWithHeartrate() throws IOException, ParseException, GPXTrackEmptyException, ParserConfigurationException, SAXException {
final List<ActivityPoint> points = readActivityPoints("/GPXExporterTest-SampleTracksHR.csv");
final GPXExporter gpxExporter = new GPXExporter();
gpxExporter.setCreator("Gadgetbridge Test");
final ActivityTrack track = createTestTrack(points);
final File tempFile = File.createTempFile("gpx-exporter-test-track", ".gpx");
tempFile.deleteOnExit();
gpxExporter.performExport(track, tempFile);
validateGpxFile(tempFile);
}
private ActivityTrack createTestTrack(List<ActivityPoint> points) {
final User user = new User();
user.setName("Test User");
Device device = new Device();
device.setName("Test Device");
final ActivityTrack track = new ActivityTrack();
track.setName("Test Track");
track.setBaseTime(new Date());
track.setUser(user);
track.setDevice(device);
for (final ActivityPoint point : points) {
track.addTrackPoint(point);
}
return track;
}
private List<ActivityPoint> readActivityPoints(String resourcePath) throws IOException, ParseException {
final List<ActivityPoint> points = new ArrayList<>();
try (final InputStream inputStream = getClass().getResourceAsStream(resourcePath)) {
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
String nextLine = reader.readLine();
while (nextLine != null) {
final String[] pieces = nextLine.split("\\s+");
final ActivityPoint point = new ActivityPoint();
point.setLocation(new GPSCoordinate(
Double.parseDouble(pieces[0]),
Double.parseDouble(pieces[1]),
Double.parseDouble(pieces[2]))
);
final int dateIndex;
if (pieces.length == 5) {
point.setHeartRate(Integer.parseInt(pieces[3]));
dateIndex = 4;
} else {
dateIndex = 3;
}
// Not sure about this parser but seemed safe to use
point.setTime(ISO8601Utils.parse(pieces[dateIndex], new ParsePosition(0)));
points.add(point);
nextLine = reader.readLine();
}
}
}
return points;
}
private void validateGpxFile(File tempFile) throws SAXException, IOException {
final Source xmlFile = new StreamSource(tempFile);
final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
final Schema schema = schemaFactory.newSchema(new StreamSource(getClass().getResourceAsStream("/gpx.xsd")));
final Validator validator = schema.newValidator();
validator.validate(xmlFile);
}
}

View File

@ -0,0 +1,14 @@
-68.200293 44.152462 40 2019-01-01T00:00:00Z
-68.20027 44.15246 40 2019-01-01T00:00:01Z
-68.20026 44.152462 40 2019-01-01T00:00:02Z
-68.200242 44.152493 40 2019-01-01T00:00:03Z
-68.200237 44.152528 40 2019-01-01T00:00:04Z
-68.200232 44.152567 40 2019-01-01T00:00:05Z
-68.200248 44.152612 40 2019-01-01T00:00:06Z
-68.200253 44.152657 40 2019-01-01T00:00:07Z
-68.200245 44.152675 46 2019-01-01T00:00:08Z
-68.200232 44.152695 46 2019-01-01T00:00:09Z
-68.200215 44.15272 46 2019-01-01T00:00:10Z
-68.200205 44.152753 46 2019-01-01T00:00:11Z
-68.200197 44.152808 46 2019-01-01T00:00:12Z
-68.200203 44.152877 46 2019-01-01T00:00:13Z
1 -68.200293 44.152462 40 2019-01-01T00:00:00Z
2 -68.20027 44.15246 40 2019-01-01T00:00:01Z
3 -68.20026 44.152462 40 2019-01-01T00:00:02Z
4 -68.200242 44.152493 40 2019-01-01T00:00:03Z
5 -68.200237 44.152528 40 2019-01-01T00:00:04Z
6 -68.200232 44.152567 40 2019-01-01T00:00:05Z
7 -68.200248 44.152612 40 2019-01-01T00:00:06Z
8 -68.200253 44.152657 40 2019-01-01T00:00:07Z
9 -68.200245 44.152675 46 2019-01-01T00:00:08Z
10 -68.200232 44.152695 46 2019-01-01T00:00:09Z
11 -68.200215 44.15272 46 2019-01-01T00:00:10Z
12 -68.200205 44.152753 46 2019-01-01T00:00:11Z
13 -68.200197 44.152808 46 2019-01-01T00:00:12Z
14 -68.200203 44.152877 46 2019-01-01T00:00:13Z

View File

@ -0,0 +1,14 @@
-68.73127 43.101062 40 91 2019-01-01T00:00:00Z
-68.73126 43.101093 40 91 2019-01-01T00:00:01Z
-68.731242 43.101128 40 91 2019-01-01T00:00:02Z
-68.731237 43.101167 40 91 2019-01-01T00:00:03Z
-68.731232 43.101212 40 91 2019-01-01T00:00:04Z
-68.731248 43.101257 40 92 2019-01-01T00:00:05Z
-68.731253 43.101275 40 92 2019-01-01T00:00:06Z
-68.731245 43.101295 46 93 2019-01-01T00:00:07Z
-68.731232 43.10132 46 94 2019-01-01T00:00:08Z
-68.731215 43.101353 46 95 2019-01-01T00:00:09Z
-68.731205 43.101408 46 95 2019-01-01T00:00:10Z
-68.731197 43.101477 46 95 2019-01-01T00:00:11Z
-68.731203 43.10152 46 96 2019-01-01T00:00:12Z
-68.73121 43.101565 45 96 2019-01-01T00:00:13Z
1 -68.73127 43.101062 40 91 2019-01-01T00:00:00Z
2 -68.73126 43.101093 40 91 2019-01-01T00:00:01Z
3 -68.731242 43.101128 40 91 2019-01-01T00:00:02Z
4 -68.731237 43.101167 40 91 2019-01-01T00:00:03Z
5 -68.731232 43.101212 40 91 2019-01-01T00:00:04Z
6 -68.731248 43.101257 40 92 2019-01-01T00:00:05Z
7 -68.731253 43.101275 40 92 2019-01-01T00:00:06Z
8 -68.731245 43.101295 46 93 2019-01-01T00:00:07Z
9 -68.731232 43.10132 46 94 2019-01-01T00:00:08Z
10 -68.731215 43.101353 46 95 2019-01-01T00:00:09Z
11 -68.731205 43.101408 46 95 2019-01-01T00:00:10Z
12 -68.731197 43.101477 46 95 2019-01-01T00:00:11Z
13 -68.731203 43.10152 46 96 2019-01-01T00:00:12Z
14 -68.73121 43.101565 45 96 2019-01-01T00:00:13Z

View File

@ -0,0 +1,784 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.topografix.com/GPX/1/1" targetNamespace="http://www.topografix.com/GPX/1/1" elementFormDefault="qualified">
<xsd:annotation>
<xsd:documentation>
GPX schema version 1.1 - For more information on GPX and this schema, visit http://www.topografix.com/gpx.asp
GPX uses the following conventions: all coordinates are relative to the WGS84 datum. All measurements are in metric units.
</xsd:documentation>
</xsd:annotation>
<xsd:element name="gpx" type="gpxType">
<xsd:annotation>
<xsd:documentation>
GPX is the root element in the XML file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="gpxType">
<xsd:annotation>
<xsd:documentation>
GPX documents contain a metadata header, followed by waypoints, routes, and tracks. You can add your own elements
to the extensions section of the GPX document.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="metadata" type="metadataType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Metadata about the file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="wpt" type="wptType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
A list of waypoints.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="rte" type="rteType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
A list of routes.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="trk" type="trkType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
A list of tracks.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="extensions" type="extensionsType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
You can add extend GPX by adding your own elements from another schema here.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="version" type="xsd:string" use="required" fixed="1.1">
<xsd:annotation>
<xsd:documentation>
You must include the version number in your GPX document.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="creator" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>
You must include the name or URL of the software that created your GPX document. This allows others to
inform the creator of a GPX instance document that fails to validate.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="metadataType">
<xsd:annotation>
<xsd:documentation>
Information about the GPX file, author, and copyright restrictions goes in the metadata section. Providing rich,
meaningful information about your GPX files allows others to search for and use your GPS data.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence> <!-- elements must appear in this order -->
<xsd:element name="name" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The name of the GPX file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="desc" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
A description of the contents of the GPX file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="author" type="personType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The person or organization who created the GPX file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="copyright" type="copyrightType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Copyright and license information governing use of the file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="link" type="linkType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
URLs associated with the location described in the file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="time" type="xsd:dateTime" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The creation date of the file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="keywords" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Keywords associated with the file. Search engines or databases can use this information to classify the data.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="bounds" type="boundsType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Minimum and maximum coordinates which describe the extent of the coordinates in the file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="extensions" type="extensionsType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
You can add extend GPX by adding your own elements from another schema here.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="wptType">
<xsd:annotation>
<xsd:documentation>
wpt represents a waypoint, point of interest, or named feature on a map.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence> <!-- elements must appear in this order -->
<!-- Position info -->
<xsd:element name="ele" type="xsd:decimal" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Elevation (in meters) of the point.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="time" type="xsd:dateTime" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Creation/modification timestamp for element. Date and time in are in Univeral Coordinated Time (UTC), not local time! Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="magvar" type="degreesType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Magnetic variation (in degrees) at the point
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="geoidheight" type="xsd:decimal" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<!-- Description info -->
<xsd:element name="name" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The GPS name of the waypoint. This field will be transferred to and from the GPS. GPX does not place restrictions on the length of this field or the characters contained in it. It is up to the receiving application to validate the field before sending it to the GPS.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="cmt" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
GPS waypoint comment. Sent to GPS as comment.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="desc" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
A text description of the element. Holds additional information about the element intended for the user, not the GPS.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="src" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Source of data. Included to give user some idea of reliability and accuracy of data. "Garmin eTrex", "USGS quad Boston North", e.g.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="link" type="linkType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Link to additional information about the waypoint.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="sym" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol as displayed on the GPS. If the GPS abbreviates words, spell them out.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="type" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Type (classification) of the waypoint.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<!-- Accuracy info -->
<xsd:element name="fix" type="fixType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Type of GPX fix.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="sat" type="xsd:nonNegativeInteger" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Number of satellites used to calculate the GPX fix.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="hdop" type="xsd:decimal" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Horizontal dilution of precision.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="vdop" type="xsd:decimal" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Vertical dilution of precision.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="pdop" type="xsd:decimal" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Position dilution of precision.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ageofdgpsdata" type="xsd:decimal" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Number of seconds since last DGPS update.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="dgpsid" type="dgpsStationType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
ID of DGPS station used in differential correction.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="extensions" type="extensionsType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
You can add extend GPX by adding your own elements from another schema here.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="lat" type="latitudeType" use="required">
<xsd:annotation>
<xsd:documentation>
The latitude of the point. This is always in decimal degrees, and always in WGS84 datum.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="lon" type="longitudeType" use="required">
<xsd:annotation>
<xsd:documentation>
The longitude of the point. This is always in decimal degrees, and always in WGS84 datum.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="rteType">
<xsd:annotation>
<xsd:documentation>
rte represents route - an ordered list of waypoints representing a series of turn points leading to a destination.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
GPS name of route.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="cmt" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
GPS comment for route.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="desc" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Text description of route for user. Not sent to GPS.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="src" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Source of data. Included to give user some idea of reliability and accuracy of data.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="link" type="linkType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Links to external information about the route.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="number" type="xsd:nonNegativeInteger" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
GPS route number.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="type" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Type (classification) of route.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="extensions" type="extensionsType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
You can add extend GPX by adding your own elements from another schema here.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="rtept" type="wptType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
A list of route points.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="trkType">
<xsd:annotation>
<xsd:documentation>
trk represents a track - an ordered list of points describing a path.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
GPS name of track.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="cmt" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
GPS comment for track.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="desc" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
User description of track.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="src" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Source of data. Included to give user some idea of reliability and accuracy of data.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="link" type="linkType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Links to external information about track.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="number" type="xsd:nonNegativeInteger" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
GPS track number.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="type" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Type (classification) of track.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="extensions" type="extensionsType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
You can add extend GPX by adding your own elements from another schema here.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="trkseg" type="trksegType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="extensionsType">
<xsd:annotation>
<xsd:documentation>
You can add extend GPX by adding your own elements from another schema here.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
You can add extend GPX by adding your own elements from another schema here.
</xsd:documentation>
</xsd:annotation>
</xsd:any>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="trksegType">
<xsd:annotation>
<xsd:documentation>
A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence> <!-- elements must appear in this order -->
<xsd:element name="trkpt" type="wptType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
A Track Point holds the coordinates, elevation, timestamp, and metadata for a single point in a track.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="extensions" type="extensionsType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
You can add extend GPX by adding your own elements from another schema here.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="copyrightType">
<xsd:annotation>
<xsd:documentation>
Information about the copyright holder and any license governing use of this file. By linking to an appropriate license,
you may place your data into the public domain or grant additional usage rights.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence> <!-- elements must appear in this order -->
<xsd:element name="year" type="xsd:gYear" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Year of copyright.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="license" type="xsd:anyURI" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Link to external file containing license text.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="author" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>
Copyright holder (TopoSoft, Inc.)
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="linkType">
<xsd:annotation>
<xsd:documentation>
A link to an external resource (Web page, digital photo, video clip, etc) with additional information.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence> <!-- elements must appear in this order -->
<xsd:element name="text" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Text of hyperlink.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="type" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Mime type of content (image/jpeg)
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="href" type="xsd:anyURI" use="required">
<xsd:annotation>
<xsd:documentation>
URL of hyperlink.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="emailType">
<xsd:annotation>
<xsd:documentation>
An email address. Broken into two parts (id and domain) to help prevent email harvesting.
</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="id" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>
id half of email address (billgates2004)
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="domain" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>
domain half of email address (hotmail.com)
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="personType">
<xsd:annotation>
<xsd:documentation>
A person or organization.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence> <!-- elements must appear in this order -->
<xsd:element name="name" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Name of person or organization.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="email" type="emailType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Email address.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="link" type="linkType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Link to Web site or other external information about person.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ptType">
<xsd:annotation>
<xsd:documentation>
A geographic point with optional elevation and time. Available for use by other schemas.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence> <!-- elements must appear in this order -->
<xsd:element name="ele" type="xsd:decimal" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The elevation (in meters) of the point.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="time" type="xsd:dateTime" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The time that the point was recorded.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="lat" type="latitudeType" use="required">
<xsd:annotation>
<xsd:documentation>
The latitude of the point. Decimal degrees, WGS84 datum.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="lon" type="longitudeType" use="required">
<xsd:annotation>
<xsd:documentation>
The latitude of the point. Decimal degrees, WGS84 datum.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="ptsegType">
<xsd:annotation>
<xsd:documentation>
An ordered sequence of points. (for polygons or polylines, e.g.)
</xsd:documentation>
</xsd:annotation>
<xsd:sequence> <!-- elements must appear in this order -->
<xsd:element name="pt" type="ptType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Ordered list of geographic points.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="boundsType">
<xsd:annotation>
<xsd:documentation>
Two lat/lon pairs defining the extent of an element.
</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="minlat" type="latitudeType" use="required">
<xsd:annotation>
<xsd:documentation>
The minimum latitude.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="minlon" type="longitudeType" use="required">
<xsd:annotation>
<xsd:documentation>
The minimum longitude.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="maxlat" type="latitudeType" use="required">
<xsd:annotation>
<xsd:documentation>
The maximum latitude.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="maxlon" type="longitudeType" use="required">
<xsd:annotation>
<xsd:documentation>
The maximum longitude.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:simpleType name="latitudeType">
<xsd:annotation>
<xsd:documentation>
The latitude of the point. Decimal degrees, WGS84 datum.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:decimal">
<xsd:minInclusive value="-90.0"/>
<xsd:maxInclusive value="90.0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="longitudeType">
<xsd:annotation>
<xsd:documentation>
The longitude of the point. Decimal degrees, WGS84 datum.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:decimal">
<xsd:minInclusive value="-180.0"/>
<xsd:maxExclusive value="180.0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="degreesType">
<xsd:annotation>
<xsd:documentation>
Used for bearing, heading, course. Units are decimal degrees, true (not magnetic).
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:decimal">
<xsd:minInclusive value="0.0"/>
<xsd:maxExclusive value="360.0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="fixType">
<xsd:annotation>
<xsd:documentation>
Type of GPS fix. none means GPS had no fix. To signify "the fix info is unknown, leave out fixType entirely. pps = military signal used
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none"/>
<xsd:enumeration value="2d"/>
<xsd:enumeration value="3d"/>
<xsd:enumeration value="dgps"/>
<xsd:enumeration value="pps"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="dgpsStationType">
<xsd:annotation>
<xsd:documentation>
Represents a differential GPS station.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="1023"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>