git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More track data.
[utils]
/
gps
/
src
/
main
/
java
/
org
/
wamblee
/
gpx
/
GpxPlotter.java
diff --git
a/gps/src/main/java/org/wamblee/gpx/GpxPlotter.java
b/gps/src/main/java/org/wamblee/gpx/GpxPlotter.java
index a14851013e18bffc44377236d608678cc78c9cf7..ad7b187e4826372d9195477aeb5b3aedb12c110d 100644
(file)
--- a/
gps/src/main/java/org/wamblee/gpx/GpxPlotter.java
+++ b/
gps/src/main/java/org/wamblee/gpx/GpxPlotter.java
@@
-40,7
+40,7
@@
import org.wamblee.general.Pair;
import org.wamblee.gps.geometry.Plane;
import org.wamblee.gps.geometry.Point;
import org.wamblee.gps.geometry.ReferenceCoordinateSystem;
import org.wamblee.gps.geometry.Plane;
import org.wamblee.gps.geometry.Point;
import org.wamblee.gps.geometry.ReferenceCoordinateSystem;
-import org.wamblee.gps.track.Track;
+import org.wamblee.gps.track.Track
Segment
;
import org.wamblee.utils.JpegUtils;
/**
import org.wamblee.utils.JpegUtils;
/**
@@
-54,7
+54,10
@@
public class GpxPlotter {
public static void main(String[] aArgs) throws Exception {
File file = new File(aArgs[0]);
GpxParser parser = new GpxParser();
public static void main(String[] aArgs) throws Exception {
File file = new File(aArgs[0]);
GpxParser parser = new GpxParser();
- Track track = parser.parse(new FileInputStream(file));
+ TrackSegment track = parser.parse(file.getName(), new FileInputStream(file));
+
+ TrackStatistics profile = new TrackStatistics(track);
+ profile.writeHeightProfilePng(new FileOutputStream("x.png"), 600, 300);
List<Pair<Double,Double>> elevationProfile = computeElevationProfile(track);
printTrack(elevationProfile);
List<Pair<Double,Double>> elevationProfile = computeElevationProfile(track);
printTrack(elevationProfile);
@@
-65,7
+68,7
@@
public class GpxPlotter {
plotTrack(trackLatLon);
}
plotTrack(trackLatLon);
}
- private static List<Pair<Double, Double>> computeElevationProfile(Track aTrack) {
+ private static List<Pair<Double, Double>> computeElevationProfile(Track
Segment
aTrack) {
List<Pair<Double,Double>> results = new ArrayList<Pair<Double,Double>>();
double distance = 0.0;
for (int i = 0; i < aTrack.size(); i++) {
List<Pair<Double,Double>> results = new ArrayList<Pair<Double,Double>>();
double distance = 0.0;
for (int i = 0; i < aTrack.size(); i++) {
@@
-79,7
+82,7
@@
public class GpxPlotter {
return results;
}
return results;
}
- private static List<Pair<Double, Double>> computeTrackXY(Track aTrack) {
+ private static List<Pair<Double, Double>> computeTrackXY(Track
Segment
aTrack) {
Point reference = aTrack.getPoint(0);
Plane plane = new Plane(reference, reference); // assume the earth is spherical.
List<Pair<Double,Double>> results = new ArrayList<Pair<Double,Double>>();
Point reference = aTrack.getPoint(0);
Plane plane = new Plane(reference, reference); // assume the earth is spherical.
List<Pair<Double,Double>> results = new ArrayList<Pair<Double,Double>>();
@@
-92,7
+95,7
@@
public class GpxPlotter {
return results;
}
return results;
}
- private static List<Pair<Double, Double>> computeTrackLatLon(Track aTrack) {
+ private static List<Pair<Double, Double>> computeTrackLatLon(Track
Segment
aTrack) {
List<Pair<Double,Double>> results = new ArrayList<Pair<Double,Double>>();
for (int i = 0; i < aTrack.size(); i++) {
Point point = aTrack.getPoint(i);
List<Pair<Double,Double>> results = new ArrayList<Pair<Double,Double>>();
for (int i = 0; i < aTrack.size(); i++) {
Point point = aTrack.getPoint(i);