Ticket #19165: 19165.patch
| File 19165.patch, 1.6 KB (added by , 6 years ago) |
|---|
-
src/org/openstreetmap/josm/plugins/pbf/io/PbfWriter.java
485 485 public void process(DataSet ds) { 486 486 processor.processSources(ds.getDataSources()); 487 487 Comparator<OsmPrimitive> cmp = Comparator.comparingLong(OsmPrimitive::getUniqueId); 488 ds.getNodes().stream().sorted(cmp).filter(n -> n.isLatLonKnown()).forEach(processor::processNode);489 ds.getWays().stream().sorted(cmp).filter(w -> w.getNodesCount() > 0).forEach(processor::processWay);490 ds.getRelations().stream().sorted(cmp).filter(r -> r.getMembersCount() > 0).forEach(processor::processRelation);488 ds.getNodes().stream().sorted(cmp).filter(n -> shouldWrite(n)).forEach(processor::processNode); 489 ds.getWays().stream().sorted(cmp).filter(w -> shouldWrite(w)).forEach(processor::processWay); 490 ds.getRelations().stream().sorted(cmp).filter(r -> shouldWrite(r)).forEach(processor::processRelation); 491 491 } 492 492 493 493 public void complete() { … … 499 499 throw new RuntimeException("Unable to complete the PBF file.", e); 500 500 } 501 501 } 502 503 private static boolean shouldWrite(OsmPrimitive osm) { 504 // see OsmWriter 505 return (!osm.isNewOrUndeleted() || !osm.isDeleted()) && !osm.isIncomplete(); 506 } 507 502 508 } 503 509 504 510 /**
