Ticket #19199: 19199.gpx_to_osm.patch

File 19199.gpx_to_osm.patch, 1.6 KB (added by taylor.smock, 4 years ago)

Send ways that will be simplified due to converting from GPX to OSM data

  • src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java

     
    88import java.awt.event.ActionEvent;
    99import java.io.File;
    1010import java.util.ArrayList;
     11import java.util.List;
    1112
    1213import javax.swing.AbstractAction;
    1314import javax.swing.JLabel;
     
    1617
    1718import org.openstreetmap.josm.actions.SimplifyWayAction;
    1819import org.openstreetmap.josm.data.osm.DataSet;
     20import org.openstreetmap.josm.data.osm.Way;
    1921import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
    2022import org.openstreetmap.josm.gui.MainApplication;
    2123import org.openstreetmap.josm.gui.layer.Layer;
     
    6466        }
    6567        final DataSet ds = convert();
    6668        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);
    6871            if (err > 0) {
    69                 SimplifyWayAction.simplifyWays(new ArrayList<>(ds.getWays()), err);
     72                SimplifyWayAction.simplifyWays(ways, err);
    7073            }
    7174            final OsmDataLayer osmLayer = new OsmDataLayer(ds, tr("Converted from: {0}", layer.getName()), null);
    7275            if (layer.getAssociatedFile() != null) {