Ignore:
Timestamp:
2022-06-14T20:11:21+02:00 (4 years ago)
Author:
taylor.smock
Message:

see #22104: Remove usages of Node#getCoor where possible

This also accounts for cases where Node has the methods used later,
so a new LatLon is unnecessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/CustomizePublicTransportStop/src/org/openstreetmap/josm/plugins/customizepublictransportstop/StopAreaOperationBase.java

    r34501 r35976  
    115115        if (platform instanceof Way) {
    116116            // p = mapView.getPoint((Node) stopArea.selectedObject);
    117             Double sumLat = 0.0;
    118             Double sumLon = 0.0;
    119             Integer countNode = 0;
     117            double sumLat = 0.0;
     118            double sumLon = 0.0;
     119            final int countNode = ((Way) platform).getNodesCount();
    120120            for (Node node : ((Way) platform).getNodes()) {
    121                 LatLon coord = node.getCoor();
    122                 sumLat += coord.getX();
    123                 sumLon += coord.getY();
    124                 countNode++;
     121                sumLat += node.lat();
     122                sumLon += node.lon();
    125123            }
    126124            return new LatLon(sumLon / countNode, sumLat / countNode);
Note: See TracChangeset for help on using the changeset viewer.