Ignore:
Timestamp:
2022-06-14T20:11:21+02:00 (2 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/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/RoutePatternAction.java

    r34718 r35976  
    18681868                    if ("backward".equals(itineraryData.getValueAt(i, 1))) {
    18691869                        for (int j = way.getNodesCount() - 2; j >= 0; --j) {
    1870                             SegmentMetric sm = new SegmentMetric(way.getNode(j + 1).getCoor().lat(),
    1871                                     way.getNode(j + 1).getCoor().lon(),
    1872                                     way.getNode(j).getCoor().lat(), way.getNode(j).getCoor().lon(),
     1870                            SegmentMetric sm = new SegmentMetric(way.getNode(j + 1).lat(),
     1871                                    way.getNode(j + 1).lon(),
     1872                                    way.getNode(j).lat(), way.getNode(j).lon(),
    18731873                                    distance);
    18741874                            segmentMetrics.add(sm);
     
    18771877                    } else {
    18781878                        for (int j = 0; j < way.getNodesCount() - 1; ++j) {
    1879                             SegmentMetric sm = new SegmentMetric(way.getNode(j).getCoor().lat(),
    1880                                     way.getNode(j).getCoor().lon(),
    1881                                     way.getNode(j + 1).getCoor().lat(),
    1882                                     way.getNode(j + 1).getCoor().lon(), distance);
     1879                            SegmentMetric sm = new SegmentMetric(way.getNode(j).lat(),
     1880                                    way.getNode(j).lon(),
     1881                                    way.getNode(j + 1).lat(),
     1882                                    way.getNode(j + 1).lon(), distance);
    18831883                            segmentMetrics.add(sm);
    18841884                            distance += sm.length;
     
    18941894    private StopReference detectMinDistance(Node node, Vector<SegmentMetric> segmentMetrics,
    18951895            boolean rhsPossible, boolean lhsPossible) {
    1896         if (node == null || node.getCoor() == null)
     1896        if (node == null || !node.isLatLonKnown())
    18971897            return null;
    18981898
     
    19001900        double position = -1.0;
    19011901        double distance = 180.0;
    1902         double lat = node.getCoor().lat();
    1903         double lon = node.getCoor().lon();
     1902        double lat = node.lat();
     1903        double lon = node.lon();
    19041904
    19051905        int curIndex = -2;
Note: See TracChangeset for help on using the changeset viewer.