Ticket #19199: 19199.gpx_to_osm.patch
File 19199.gpx_to_osm.patch, 1.6 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java
8 8 import java.awt.event.ActionEvent; 9 9 import java.io.File; 10 10 import java.util.ArrayList; 11 import java.util.List; 11 12 12 13 import javax.swing.AbstractAction; 13 14 import javax.swing.JLabel; … … 16 17 17 18 import org.openstreetmap.josm.actions.SimplifyWayAction; 18 19 import org.openstreetmap.josm.data.osm.DataSet; 20 import org.openstreetmap.josm.data.osm.Way; 19 21 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 20 22 import org.openstreetmap.josm.gui.MainApplication; 21 23 import org.openstreetmap.josm.gui.layer.Layer; … … 64 66 } 65 67 final DataSet ds = convert(); 66 68 if (ds != null) { 67 double err = SimplifyWayAction.askSimplifyWays(tr("Would you like to simplify the ways in the converted layer?"), true); 69 List<Way> ways = new ArrayList<>(ds.getWays()); 70 double err = SimplifyWayAction.askSimplifyWays(ways, tr("Would you like to simplify the ways in the converted layer?"), true); 68 71 if (err > 0) { 69 SimplifyWayAction.simplifyWays( new ArrayList<>(ds.getWays()), err);72 SimplifyWayAction.simplifyWays(ways, err); 70 73 } 71 74 final OsmDataLayer osmLayer = new OsmDataLayer(ds, tr("Converted from: {0}", layer.getName()), null); 72 75 if (layer.getAssociatedFile() != null) {