Fix route points

This commit is contained in:
cepprice 2021-04-07 12:10:17 +05:00
parent 14272afa44
commit 077f57c830

View file

@ -141,9 +141,18 @@ public class MultiProfileGeometryWay extends GeometryWay<MultiProfileGeometryWay
routePoints.add(new LatLon(start.lat, start.lon)); routePoints.add(new LatLon(start.lat, start.lon));
routePoints.add(new LatLon(end.lat, end.lon)); routePoints.add(new LatLon(end.lat, end.lon));
} else { } else {
List<WptPt> points = roadSegmentData.getPoints();
if (points.get(0).getLatitude() != start.getLatitude() && points.get(0).getLongitude() != start.getLongitude()) {
routePoints.add(new LatLon(start.lat, start.lon));
}
for (WptPt routePt : roadSegmentData.getPoints()) { for (WptPt routePt : roadSegmentData.getPoints()) {
routePoints.add(new LatLon(routePt.lat, routePt.lon)); routePoints.add(new LatLon(routePt.lat, routePt.lon));
} }
int lastIdx = routePoints.size() - 1;
if (routePoints.get(lastIdx).getLatitude() != end.getLatitude()
&& routePoints.get(lastIdx).getLongitude() != end.getLongitude()) {
routePoints.add(new LatLon(end.lat, end.lon));
}
} }
return routePoints; return routePoints;
} }