this.crosses180th = downloadArea.crosses180thMeridian();
}
private GpxData downloadRawGps(String url, ProgressMonitor progressMonitor) throws IOException, OsmTransferException, SAXException {
boolean done = false;
GpxData result = null;
for (int i = 0;!done;++i) {
progressMonitor.subTask(tr("Downloading points {0} to {1}...", i * 5000, ((i + 1) * 5000)));
try (InputStream in = getInputStream(url+i, progressMonitor.createSubTaskMonitor(1, true))) {
if (in == null) {
break;
}
progressMonitor.setTicks(0);
GpxReader reader = new GpxReader(in);
gpxParsedProperly = reader.parse(false);
GpxData currentGpx = reader.getGpxData();
if (result == null) {
result = currentGpx;
} else if (currentGpx.hasTrackPoints()) {
result.mergeFrom(currentGpx);
} else{
done = true;
}
}