git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(no commit message)
[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 f239cabf4a3b7aadc01807f000f0ea0caf45b3dd..ad7b187e4826372d9195477aeb5b3aedb12c110d 100644
(file)
--- a/
gps/src/main/java/org/wamblee/gpx/GpxPlotter.java
+++ b/
gps/src/main/java/org/wamblee/gpx/GpxPlotter.java
@@
-40,19
+40,24
@@
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;
/**
* Parses a GPX file and prints out a data file with each trackpoints distance from the start of the
* track and its elevation, separated 0by a space.
import org.wamblee.utils.JpegUtils;
/**
* Parses a GPX file and prints out a data file with each trackpoints distance from the start of the
* track and its elevation, separated 0by a space.
+ *
+ * @author Erik Brakkee
*/
public class GpxPlotter {
public static void main(String[] aArgs) throws Exception {
File file = new File(aArgs[0]);
GpxParser parser = new GpxParser();
*/
public class GpxPlotter {
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);
@@
-63,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++) {
@@
-77,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>>();
@@
-90,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);