-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eeaa77f
commit 367f706
Showing
24 changed files
with
2,749 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
bin/ | ||
|
||
*.class | ||
|
||
# Mobile Tools for Java (J2ME) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>gpx-parser</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.hs.gpxparser; | ||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.ArrayList; | ||
|
||
import com.hs.gpxparser.extension.IExtensionParser; | ||
|
||
class BaseGPX { | ||
|
||
protected final SimpleDateFormat xmlDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss'Z'"); | ||
protected final ArrayList<IExtensionParser> extensionParsers = new ArrayList<IExtensionParser>(); | ||
|
||
/** | ||
* Adds a new extension parser to be used when parsing a gpx steam | ||
* | ||
* @param parser | ||
* an instance of a {@link IExtensionParser} implementation | ||
*/ | ||
public void addExtensionParser(IExtensionParser parser) { | ||
this.extensionParsers.add(parser); | ||
} | ||
|
||
/** | ||
* Removes an extension parser previously added | ||
* | ||
* @param parser | ||
* an instance of a {@link IExtensionParser} implementation | ||
*/ | ||
public void removeExtensionParser(IExtensionParser parser) { | ||
this.extensionParsers.remove(parser); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
package com.hs.gpxparser; | ||
|
||
public interface GPXConstants { | ||
|
||
/* Root Node */ | ||
String NODE_GPX = "gpx"; | ||
|
||
/* GPX nodes and attributes */ | ||
String ATTR_CREATOR = "creator"; | ||
String ATTR_VERSION = "version"; | ||
|
||
String NODE_METADATA = "metadata"; | ||
String NODE_TRK = "trk"; | ||
String NODE_RTE = "rte"; | ||
String NODE_WPT = "wpt"; | ||
String NODE_EXTENSIONS = "extensions"; | ||
/* End GPX nodes and attributes */ | ||
|
||
/* metadata nodes and attributes */ | ||
String NODE_NAME = "name"; | ||
String NODE_DESC = "desc"; | ||
String NODE_AUTHOR = "author"; | ||
String NODE_COPYRIGHT = "copyright"; | ||
String NODE_LINK = "link"; | ||
String NODE_TIME = "time"; | ||
String NODE_KEYWORDS = "keywords"; | ||
String NODE_BOUNDS = "bounds"; | ||
// String NODE_EXTENSIONS = "extensions"; | ||
/* end metadata nodes and attributes */ | ||
|
||
/* Waypoint nodes and attributes */ | ||
String ATTR_LAT = "lat"; | ||
String ATTR_LON = "lon"; | ||
|
||
String NODE_ELE = "ele"; | ||
// String NODE_TIME = "time"; | ||
String NODE_MAGVAR = "magvar"; | ||
String NODE_GEOIDHEIGHT = "geoidheight"; | ||
// String NODE_NAME = "name"; | ||
String NODE_CMT = "cmt"; | ||
// String NODE_DESC = "desc"; | ||
String NODE_SRC = "src"; | ||
// String NODE_LINK = "link"; | ||
String NODE_SYM = "sym"; | ||
String NODE_TYPE = "type"; | ||
String NODE_FIX = "fix"; | ||
String NODE_SAT = "sat"; | ||
String NODE_HDOP = "hdop"; | ||
String NODE_VDOP = "vdop"; | ||
String NODE_PDOP = "pdop"; | ||
String NODE_AGEOFGPSDATA = "ageofdgpsdata"; | ||
String NODE_DGPSID = "dgpsid"; | ||
// String NODE_EXTENSIONS = "extensions"; | ||
/* end Waypoint nodes and attributes */ | ||
|
||
/* Route nodes */ | ||
// String NODE_NAME = "name"; | ||
// String NODE_CMT = "cmt"; | ||
// String NODE_DESC = "desc"; | ||
// String NODE_SRC = "src"; | ||
// String NODE_LINK = "link"; | ||
String NODE_NUMBER = "number"; | ||
// String NODE_TYPE = "type"; | ||
// String NODE_EXTENSIONS = "extensions"; | ||
String NODE_RTEPT = "rtept"; | ||
/* end route nodes */ | ||
|
||
/* Track nodes and attributes */ | ||
// String NODE_NAME = "name"; | ||
// String NODE_CMT = "cmt"; | ||
// String NODE_DESC = "desc"; | ||
// String NODE_SRC = "src"; | ||
// String NODE_LINK = "link"; | ||
// String NODE_NUMBER = "number"; | ||
// String NODE_TYPE = "type"; | ||
// String NODE_EXTENSIONS = "extensions"; | ||
String NODE_TRKSEG = "trkseg"; | ||
/* end Track nodes and attributes */ | ||
|
||
/* Track segment nodes */ | ||
String NODE_TRKPT = "trkpt"; | ||
// String NODE_EXTENSIONS = "extensions"; | ||
/* end Track segment nodes */ | ||
|
||
/* Copyright Nodes and Attributes */ | ||
String ATTR_AUTHOR = "author"; | ||
String NODE_YEAR = "year"; | ||
String NODE_LICENSE = "license"; | ||
/* End Copyright Nodes and Attributes */ | ||
|
||
/* Link Nodes and Attributes */ | ||
String ATTR_HREF = "href"; | ||
String NODE_TEXT = "text"; | ||
// String NODE_TYPE = "type"; | ||
/* End Link Nodes and Attributes */ | ||
|
||
/* Email attributes */ | ||
String ATTR_ID = "id"; | ||
String ATTR_DOMAIN = "domain"; | ||
/* End Email attributes */ | ||
|
||
/* Person Nodes */ | ||
// String NODE_NAME = "name"; | ||
String NODE_EMAIL = "email"; | ||
// String NODE_LINK = "link"; | ||
/* End Person Nodes */ | ||
|
||
/* Point Nodes and Attributes */ | ||
// String ATTR_LAT = "lat"; | ||
// String ATTR_LON = "lon"; | ||
|
||
// String NODE_ELE = "ele"; | ||
// String NODE_TIME = "time"; | ||
/* End Point Nodes and Attributes */ | ||
|
||
/* Point Segment Nodes */ | ||
String NODE_PT = "pt"; | ||
/* End Point Segment Nodes */ | ||
|
||
/* Bounds Attributes */ | ||
String ATTR_MINLAT = "minlat"; | ||
String ATTR_MINLON = "minlon"; | ||
String ATTR_MAXLAT = "maxlat"; | ||
String ATTR_MAXLON = "maxlon"; | ||
/* End Bounds Attributes */ | ||
|
||
} |
Oops, something went wrong.