Changeset 13647 in josm for trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java
- Timestamp:
- 2018-04-19T20:37:16+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java
r13559 r13647 25 25 import org.openstreetmap.josm.data.osm.DataSet; 26 26 import org.openstreetmap.josm.data.osm.DownloadPolicy; 27 import org.openstreetmap.josm.data.osm.UploadPolicy;28 27 import org.openstreetmap.josm.data.osm.OsmPrimitive; 29 28 import org.openstreetmap.josm.data.osm.Relation; 30 29 import org.openstreetmap.josm.data.osm.RelationMember; 30 import org.openstreetmap.josm.data.osm.UploadPolicy; 31 31 import org.openstreetmap.josm.data.osm.Way; 32 32 import org.openstreetmap.josm.io.IllegalDataException; … … 69 69 if (optimizedWays.isEmpty()) { 70 70 optimizedWays = computeOptimizedBoundaries(); 71 saveOptimizedBoundaries(optimizedWays); 71 try { 72 saveOptimizedBoundaries(optimizedWays); 73 } catch (IOException | SecurityException e) { 74 Logging.log(Logging.LEVEL_ERROR, "Unable to save optimized boundaries", e); 75 } 72 76 } 73 77 rlCache = new GeoPropertyIndex<>(new DefaultGeoProperty(optimizedWays), 24); … … 154 158 } 155 159 156 private static void saveOptimizedBoundaries(Collection<Way> optimizedWays) {160 private static void saveOptimizedBoundaries(Collection<Way> optimizedWays) throws IOException { 157 161 DataSet ds = optimizedWays.iterator().next().getDataSet(); 158 162 File file = new File(Config.getDirs().getCacheDirectory(true), "left-right-hand-traffic.osm"); … … 163 167 w.writeContent(ds); 164 168 w.footer(); 165 } catch (IOException ex) {166 throw new JosmRuntimeException(ex);167 169 } 168 170 } … … 172 174 Config.getDirs().getCacheDirectory(false).getPath(), "left-right-hand-traffic.osm"))) { 173 175 return OsmReader.parseDataSet(is, null).getWays(); 174 } catch (IllegalDataException | IOException | InvalidPathException ex) {176 } catch (IllegalDataException | IOException | InvalidPathException | SecurityException ex) { 175 177 Logging.trace(ex); 176 178 return Collections.emptyList();
Note:
See TracChangeset
for help on using the changeset viewer.