Changeset 14761 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2019-02-05T10:53:02+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r12620 r14761 51 51 boolean done = false; 52 52 GpxData result = null; 53 final int pointsPerPage = 5000; // see https://wiki.openstreetmap.org/wiki/API_v0.6#GPS_traces 53 54 String url = "trackpoints?bbox="+b.getMinLon()+','+b.getMinLat()+','+b.getMaxLon()+','+b.getMaxLat()+"&page="; 54 55 for (int i = 0; !done && !isCanceled(); ++i) { 55 progressMonitor.subTask(tr("Downloading points {0} to {1}...", i * 5000, (i + 1) *5000));56 progressMonitor.subTask(tr("Downloading points {0} to {1}...", i * pointsPerPage, (i + 1) * pointsPerPage)); 56 57 try (InputStream in = getInputStream(url+i, progressMonitor.createSubTaskMonitor(1, true))) { 57 58 if (in == null) { … … 65 66 result = currentGpx; 66 67 } else if (currentGpx.hasTrackPoints()) { 68 long count = currentGpx.getTrackPoints().count(); 69 Logging.debug("got {0} gpx points", count); 70 if (count < pointsPerPage) 71 done = true; 67 72 result.mergeFrom(currentGpx); 68 73 } else {
Note:
See TracChangeset
for help on using the changeset viewer.