Java Parser for reading and writing GPX files
using base from gpxparser
Follows GPX schema version 1.1
By using ./gradlew build
gradle will build the library, sources and javadoc in build/libs
.
Add this snippet to your build.gradle
, it includes javadoc and sources:
dependencies {
compile 'com.github.4rne:gpx-parser:master'
}
Or download this jar-library and include it into your classpath: Download JAR
To read GPX file:
GPXParser p = new GPXParser();
FileInputStream in = new FileInputStream("inFile.gpx");
GPX gpx = p.parseGPX(in);
To write to GPX file:
GPXWriter writer = new GPXWriter();
FileOutputStream out = new FileOutputStream("outFile.gpx");
writer.writeGPX(gpx, out);
out.close();