Changeset 8216 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2015-04-18T11:50:47+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r8118 r8216 162 162 163 163 @Override 164 public List<Note> parseNotes(Integer noteLimit, Integer daysClosed, ProgressMonitor progressMonitor) throws OsmTransferException {164 public List<Note> parseNotes(Integer noteLimit, Integer daysClosed, ProgressMonitor progressMonitor) throws OsmTransferException, MoreNotesException { 165 165 progressMonitor.beginTask("Downloading notes"); 166 166 noteLimit = checkNoteLimit(noteLimit); … … 180 180 InputStream is = getInputStream(url, progressMonitor.createSubTaskMonitor(1, false)); 181 181 NoteReader reader = new NoteReader(is); 182 return reader.parse(); 182 final List<Note> notes = reader.parse(); 183 if (notes.size() == noteLimit) { 184 throw new MoreNotesException(noteLimit); 185 } 186 return notes; 183 187 } catch (IOException e) { 184 188 throw new OsmTransferException(e); … … 187 191 } finally { 188 192 progressMonitor.finishTask(); 193 } 194 } 195 196 /** 197 * Indicates that the number of fetched notes equals the specified limit. Thus there might be more notes to download. 198 */ 199 public static class MoreNotesException extends RuntimeException{ 200 /** 201 * The download limit sent to the server. 202 */ 203 public final int limit; 204 205 public MoreNotesException(int limit) { 206 this.limit = limit; 189 207 } 190 208 } … … 194 212 limit = Main.pref.getInteger("osm.notes.downloadLimit", 1000); 195 213 } 196 if (limit > 10000) { 197 Main.error("Requested note limit is over API hard limit of 10000. Reducing to 10000."); 198 limit = 10000; 214 if (limit > 50000) { 215 // see max_number_of_nodes in https://github.com/openstreetmap/openstreetmap-website/blob/master/config/example.application.yml 216 Main.error("Requested note limit is over API hard limit of 50000. Reducing to 50000."); 217 limit = 50000; 199 218 } 200 219 if (limit < 1) { … … 202 221 limit = 1; 203 222 } 204 Main.debug("returning note limit: " + limit);205 223 return limit; 206 224 } … … 214 232 days = -1; 215 233 } 216 Main.debug("returning days closed: " + days);217 234 return days; 218 235 }
Note:
See TracChangeset
for help on using the changeset viewer.