}
return courseLapT;
}
private TrackT createTrack(TcxRoute route, int startIndex, int endIndex) {
ObjectFactory objectFactory = new ObjectFactory();
TrackT trackT = objectFactory.createTrackT();
List<TrackpointT> trackpoints = trackT.getTrackpoint();
List<Wgs84Position> positions = route.getPositions();
Wgs84Position previous = null;
double distance = 0.0;
for (int i = startIndex; i < endIndex; i++) {
Wgs84Position position = positions.get(i);
TrackpointT trackpointT = objectFactory.createTrackpointT();
trackpointT.setAltitudeMeters(position.getElevation());
trackpointT.setHeartRateBpm(getHeartBeatRateT(position));
trackpointT.setPosition(createPosition(position));
trackpointT.setTime(formatTime(position.getTime()));