Ignore:
Timestamp:
2019-04-29T11:36:17+02:00 (5 years ago)
Author:
gerdp
Message:

fix #17663: Ignore unusable data in PolyExporter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/poly/src/poly/PolyExporter.java

    r34966 r34991  
    4040    public void exportData(File file, Layer layer) throws IOException {
    4141        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())) {
    4344                throw new IOException(tr("Data contains unclosed ways."));
    4445            }
    4546            try (PrintWriter writer = new PrintWriter(Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8))) {
    46                 DataSet ds = ((OsmDataLayer) layer).getDataSet();
    4747                HashSet<Way> written = new HashSet<>();
    4848                boolean firstFile = true;
     
    5454
    5555                for (Relation rel : ds.getRelations()) {
    56                     if (rel.isMultipolygon()) {
     56                    if (rel.isUsable() && rel.isMultipolygon()) {
    5757                        if (!firstFile) {
    5858                            writer.println();
     
    6868                int counter = 1;
    6969                for (Way w : ds.getWays()) {
    70                     if (!written.contains(w)) {
     70                    if (w.isUsable() && !written.contains(w)) {
    7171                        writeWay(writer, w, counter);
    7272                    }
Note: See TracChangeset for help on using the changeset viewer.