if (sourcePosition instanceof TomTomPosition) {
TomTomPosition tomTomPosition = (TomTomPosition) sourcePosition;
sourceHeading = tomTomPosition.getHeading();
}
if (sourcePosition instanceof NmeaPosition) {
NmeaPosition nmeaPosition = (NmeaPosition) sourcePosition;
sourceHeading = nmeaPosition.getHeading();
}
Double targetHeading = null;
if (targetPosition instanceof Wgs84Position) {
Wgs84Position wgs84TargetPosition = (Wgs84Position) targetPosition;
targetHeading = wgs84TargetPosition.getHeading();
}
if (targetPosition instanceof TomTomPosition) {
TomTomPosition tomTomPosition = (TomTomPosition) targetPosition;
targetHeading = tomTomPosition.getHeading();
}
if (targetPosition instanceof NmeaPosition) {
NmeaPosition nmeaPosition = (NmeaPosition) targetPosition;
targetHeading = nmeaPosition.getHeading();
}
if (targetFormat instanceof ColumbusV900Format || targetFormat instanceof GpsTunerFormat) {
if (sourceFormat instanceof GoPalTrackFormat || sourceFormat instanceof ColumbusV900Format ||
sourceFormat instanceof Gpx10Format && sourceCharacteristics.equals(Track) ||