Changeset 34081 in osm for applications


Ignore:
Timestamp:
2018-02-27T20:20:24+01:00 (7 years ago)
Author:
donvip
Message:

see #josm11260 - optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/download_along/src/org/openstreetmap/josm/plugin/download_along/DownloadAlongWayAction.java

    r33710 r34081  
    2626import org.openstreetmap.josm.tools.Logging;
    2727import org.openstreetmap.josm.tools.Shortcut;
     28import org.openstreetmap.josm.tools.Utils;
    2829
    2930class DownloadAlongWayAction extends DownloadAlongAction {
     
    5758            return;
    5859        }
     60
     61        Logging.info("Starting area computation");
     62        long start = System.currentTimeMillis();
    5963
    6064        /*
     
    103107                    Double d = c.greatCircleDistance(previous) / buffer_dist;
    104108                    int nbNodes = d.intValue();
    105                     Logging.info(tr("{0} intermediate nodes to download.", nbNodes));
    106                     Logging.info(tr("between {0} {1} and {2} {3}", c.lat(), c.lon(), previous.lat(),
    107                             previous.lon()));
     109                    if (Logging.isDebugEnabled()) {
     110                        Logging.debug(tr("{0} intermediate nodes to download.", nbNodes));
     111                        Logging.debug(tr("between {0} {1} and {2} {3}", c.lat(), c.lon(), previous.lat(), previous.lon()));
     112                    }
    108113                    for (int i = 1; i < nbNodes; i++) {
    109114                        intermediateNodes.add(new LatLon(previous.lat()
    110115                                + (i * (c.lat() - previous.lat()) / (nbNodes + 1)), previous.lon()
    111116                                + (i * (c.lon() - previous.lon()) / (nbNodes + 1))));
    112                         Logging.info(tr("  adding {0} {1}", previous.lat()
    113                                 + (i * (c.lat() - previous.lat()) / (nbNodes + 1)), previous.lon()
    114                                 + (i * (c.lon() - previous.lon()) / (nbNodes + 1))));
     117                        if (Logging.isTraceEnabled()) {
     118                            Logging.trace(tr("  adding {0} {1}", previous.lat()
     119                                    + (i * (c.lat() - previous.lat()) / (nbNodes + 1)), previous.lon()
     120                                    + (i * (c.lon() - previous.lon()) / (nbNodes + 1))));
     121                        }
    115122                    }
    116123                }
     
    128135        }
    129136        Area a = new Area(path);
     137        Logging.info("Area computed in " + Utils.getDurationString(System.currentTimeMillis() - start));
    130138        confirmAndDownloadAreas(a, max_area, panel.isDownloadOsmData(), panel.isDownloadGpxData(),
    131139                tr("Download from OSM along selected ways"), NullProgressMonitor.INSTANCE);
Note: See TracChangeset for help on using the changeset viewer.