8000 GitHub - fracpete/gpsformats4j: GPS format conversions in Java.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fracpete/gpsformats4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpsformats4j

GPS format conversions in Java.

Very simple, very hacky. ;-) The main reason was to be able to convert TCX files exported from a proprietary app into GPX ones so the OsmAnd~ app can display them.

Supported formats

Currently the following formats are supported:

  • CSV (requires columns in this order: track, time, lat, lon, elevation)
  • GPX
  • TCX
  • KML (only LineString tag)

Example usage

Using it with the provided convert/convert.bat scripts:

./convert --in_file test.tcx --in_format TCX --out_file out.gpx --out_format GPX

Calling the Convert class directly:

java -cp "./lib/*" com.github.fracpete.gpsformats4j.Convert \
  --in_file test.tcx --in_format TCX --out_file out.gpx --out_format GPX

Using Java code:

import com.github.fracpete.gpsformats4j.Convert;
import com.github.fracpete.gpsformats4j.formats.GPX;
import com.github.fracpete.gpsformats4j.formats.TCX;
import java.io.File;

public class MyConversion {
  
  public static void main(String[] args) {
    Convert convert = new Convert();
    convert.setInputFile(new File("test.tcx"));
    convert.setInputFormat(TCX.class);
    convert.setOutputFile(new File("out.gpx"));
    convert.setOutputFormat(GPX.class);

    String msg = convert.execute();
    // successful if null returned:
    if (msg != null)
      System.err.println(msg);
  }
}

Releases

The following releases are available:

Maven

Use the following dependency to include the library in your Maven project:

    <dependency>
      <groupId>com.github.fracpete</groupId>
      <artifactId>gpsformats4j</artifactId>
      <version>0.0.7</version>
    </dependency>

About

GPS format conversions in Java.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0