Changeset 34991 in osm for applications/editors/josm/plugins
- Timestamp:
- 2019-04-29T11:36:17+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/poly/src/poly/PolyExporter.java
r34966 r34991 40 40 public void exportData(File file, Layer layer) throws IOException { 41 41 if (layer instanceof OsmDataLayer) { 42 if (((OsmDataLayer) layer).getDataSet().getWays().stream().anyMatch(w -> !w.isClosed())) { 42 DataSet ds = ((OsmDataLayer) layer).getDataSet(); 43 if (ds.getWays().stream().anyMatch(w -> w.isUsable() && !w.isClosed())) { 43 44 throw new IOException(tr("Data contains unclosed ways.")); 44 45 } 45 46 try (PrintWriter writer = new PrintWriter(Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8))) { 46 DataSet ds = ((OsmDataLayer) layer).getDataSet();47 47 HashSet<Way> written = new HashSet<>(); 48 48 boolean firstFile = true; … … 54 54 55 55 for (Relation rel : ds.getRelations()) { 56 if (rel.is Multipolygon()) {56 if (rel.isUsable() && rel.isMultipolygon()) { 57 57 if (!firstFile) { 58 58 writer.println(); … … 68 68 int counter = 1; 69 69 for (Way w : ds.getWays()) { 70 if ( !written.contains(w)) {70 if (w.isUsable() && !written.contains(w)) { 71 71 writeWay(writer, w, counter); 72 72 }
Note:
See TracChangeset
for help on using the changeset viewer.