Changeset 30097 in osm for applications/editors/josm/plugins/opendata/src
- Timestamp:
- 2013-11-25T02:47:26+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/DataSetUpdater.java
r28053 r30097 21 21 22 22 import org.openstreetmap.josm.Main; 23 import org.openstreetmap.josm.actions.SimplifyWayAction; 24 import org.openstreetmap.josm.command.SequenceCommand; 23 25 import org.openstreetmap.josm.data.osm.DataSet; 26 import org.openstreetmap.josm.data.osm.OsmPrimitive; 27 import org.openstreetmap.josm.data.osm.Relation; 28 import org.openstreetmap.josm.data.osm.Way; 24 29 import org.openstreetmap.josm.plugins.opendata.core.OdConstants; 25 30 … … 40 45 handler.checkDataSetSource(dataSet); 41 46 handler.checkNames(dataSet); 47 // Replace multipolygons with single untagged member by their sole member 48 for (Relation r : dataSet.getRelations()) { 49 if (r.isMultipolygon() && r.getMembersCount() == 1) { 50 OsmPrimitive outer = r.getMember(0).getMember(); 51 if (!outer.isTagged()) { 52 r.remove("type"); 53 r.removeMember(0); 54 outer.setKeys(r.getKeys()); 55 dataSet.removePrimitive(r); 56 } 57 } 58 } 59 // Simplify ways geometries 60 for (Way w : dataSet.getWays()) { 61 SequenceCommand command = Main.main.menu.simplifyWay.simplifyWay(w, 0.25); 62 if (command != null) { 63 Main.main.undoRedo.addNoRedraw(command); 64 } 65 } 42 66 } 43 67 }
Note:
See TracChangeset
for help on using the changeset viewer.