use of net.osmand.plus.GPXUtilities.GPXTrackAnalysis in project Osmand by osmandapp.
the class GPXDatabase method readItem.
private GpxDataItem readItem(SQLiteCursor query) {
String fileName = query.getString(0);
String fileDir = query.getString(1);
float totalDistance = (float) query.getDouble(2);
int totalTracks = (int) query.getInt(3);
long startTime = query.getLong(4);
long endTime = query.getLong(5);
long timeSpan = query.getLong(6);
long timeMoving = query.getLong(7);
float totalDistanceMoving = (float) query.getDouble(8);
double diffElevationUp = query.getDouble(9);
double diffElevationDown = query.getDouble(10);
double avgElevation = query.getDouble(11);
double minElevation = query.getDouble(12);
double maxElevation = query.getDouble(13);
float maxSpeed = (float) query.getDouble(14);
float avgSpeed = (float) query.getDouble(15);
int points = (int) query.getInt(16);
int wptPoints = (int) query.getInt(17);
String color = query.getString(18);
long fileLastModifiedTime = query.getLong(19);
int splitType = (int) query.getInt(20);
double splitInterval = query.getDouble(21);
boolean apiImported = query.getInt(22) == 1;
String wptCategoryNames = query.getString(23);
GPXTrackAnalysis a = new GPXTrackAnalysis();
a.totalDistance = totalDistance;
a.totalTracks = totalTracks;
a.startTime = startTime;
a.endTime = endTime;
a.timeSpan = timeSpan;
a.timeMoving = timeMoving;
a.totalDistanceMoving = totalDistanceMoving;
a.diffElevationUp = diffElevationUp;
a.diffElevationDown = diffElevationDown;
a.avgElevation = avgElevation;
a.minElevation = minElevation;
a.maxElevation = maxElevation;
a.minSpeed = maxSpeed;
a.maxSpeed = maxSpeed;
a.avgSpeed = avgSpeed;
a.points = points;
a.wptPoints = wptPoints;
if (wptCategoryNames != null) {
a.wptCategoryNames = Algorithms.decodeStringSet(wptCategoryNames);
}
File dir;
if (!Algorithms.isEmpty(fileDir)) {
dir = new File(context.getAppPath(IndexConstants.GPX_INDEX_DIR), fileDir);
} else {
dir = context.getAppPath(IndexConstants.GPX_INDEX_DIR);
}
GpxDataItem item = new GpxDataItem(new File(dir, fileName), a);
try {
item.color = Algorithms.isEmpty(color) ? 0 : Algorithms.parseColor(color);
} catch (IllegalArgumentException e) {
item.color = 0;
}
item.fileLastModifiedTime = fileLastModifiedTime;
item.splitType = splitType;
item.splitInterval = splitInterval;
item.apiImported = apiImported;
return item;
}
Aggregations