Fix RouteColorize constructor for MapCreator

This commit is contained in:
Dima-1 2021-04-05 14:12:03 +03:00
parent 3ae35a8353
commit b0b5a4cdb2

View file

@ -8,6 +8,7 @@ import net.osmand.GPXUtilities.WptPt;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.osm.edit.Node; import net.osmand.osm.edit.Node;
import net.osmand.osm.edit.OsmMapUtils; import net.osmand.osm.edit.OsmMapUtils;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils; import net.osmand.util.MapUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -81,6 +82,10 @@ public class RouteColorize {
/** /**
* @param type ELEVATION, SPEED, SLOPE * @param type ELEVATION, SPEED, SLOPE
*/ */
public RouteColorize(int zoom, GPXFile gpxFile, ColorizationType type) {
this(zoom, gpxFile, null, type, 0);
}
public RouteColorize(int zoom, GPXFile gpxFile, GPXTrackAnalysis analysis, ColorizationType type, float maxProfileSpeed) { public RouteColorize(int zoom, GPXFile gpxFile, GPXTrackAnalysis analysis, ColorizationType type, float maxProfileSpeed) {
if (!gpxFile.hasTrkPt()) { if (!gpxFile.hasTrkPt()) {
@ -91,8 +96,13 @@ public class RouteColorize {
List<Double> latList = new ArrayList<>(); List<Double> latList = new ArrayList<>();
List<Double> lonList = new ArrayList<>(); List<Double> lonList = new ArrayList<>();
List<Double> valList = new ArrayList<>(); List<Double> valList = new ArrayList<>();
int wptIdx = 0; int wptIdx = 0;
if (analysis == null) {
analysis = Algorithms.isEmpty(gpxFile.path)
? gpxFile.getAnalysis(System.currentTimeMillis())
: gpxFile.getAnalysis(gpxFile.modifiedTime);
}
for (Track t : gpxFile.tracks) { for (Track t : gpxFile.tracks) {
for (TrkSegment ts : t.segments) { for (TrkSegment ts : t.segments) {
for (WptPt p : ts.points) { for (WptPt p : ts.points) {