Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Course value isn't written to GPX file. #69

Closed
ArneKoeckeritz opened this issue Jul 27, 2018 · 3 comments
Closed

Course value isn't written to GPX file. #69

ArneKoeckeritz opened this issue Jul 27, 2018 · 3 comments

Comments

@ArneKoeckeritz
Copy link
Contributor

I have a class in my Android app which is writing a GPX file out of the location stream from the device location sensor. And there is a counterpart class which is reading the GPX file and creates a location stream out of it.

public final void onLocationChanged(final Location pLocation)
{
	final WayPoint.Builder wayPointBuilder = WayPoint.builder();
	wayPointBuilder.time(pLocation.getTime());
	wayPointBuilder.ele(pLocation.getAltitude());
	wayPointBuilder.speed(pLocation.getSpeed());
	wayPointBuilder.pdop((double) pLocation.getAccuracy());
	wayPointBuilder.course(pLocation.getBearing());
	wayPointBuilder.lat(pLocation.getLatitude());
	wayPointBuilder.lon(pLocation.getLongitude());

	mSegmentBuilder.addPoint(wayPointBuilder.build());
}

But there is a problem. The course data is not written into the GPX file which looks like a bug.
Anything i can contribute ?

@jenetics
Copy link
Owner

The JPX library allows you to read/write GPX files in version 1.0 and 1.1. I'm using the same data structures for both version. But the course value is only read/written in version 1.0. If you are using the default writer, you are writing the GPX file in version 1.1, which doesn't write the course value.

@jenetics
Copy link
Owner

I might add an implementation note to the Javadoc.

@ArneKoeckeritz
Copy link
Contributor Author

Good info i will use V1.0.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants