Ignore:
Timestamp:
2022-06-15T20:10:48+02:00 (3 years ago)
Author:
taylor.smock
Message:

See #22115: Extract methods from LatLon into ILatLon where they are generally applicable

This uses the extracted methods where possible, and removes unnecessary
Node#getCoor calls.

Location:
applications/editors/josm/plugins/terracer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/terracer/build.xml

    r35975 r35978  
    22<project name="terracer" default="dist" basedir=".">
    33    <property name="commit.message" value="applied #j5760 (patch by robome) - Order of housenumbers not correct"/>
    4     <property name="plugin.main.version" value="18464"/>
     4    <property name="plugin.main.version" value="18494"/>
    55    <property name="plugin.author" value="Matt Amos"/>
    66    <property name="plugin.class" value="org.openstreetmap.josm.plugins.terracer.TerracerPlugin"/>
  • applications/editors/josm/plugins/terracer/src/org/openstreetmap/josm/plugins/terracer/TerracerAction.java

    r35976 r35978  
    3333import org.openstreetmap.josm.data.UndoRedoHandler;
    3434import org.openstreetmap.josm.data.coor.ILatLon;
    35 import org.openstreetmap.josm.data.coor.LatLon;
    3635import org.openstreetmap.josm.data.osm.DataSet;
    3736import org.openstreetmap.josm.data.osm.Node;
     
    572571        for (int i = 0; i < pairs.size(); ++i) {
    573572            Pair<Node, Node> p = pairs.get(i);
    574             final double seg_length = p.a.getCoor().greatCircleDistance(p.b.getCoor());
     573            final double seg_length = p.a.greatCircleDistance(p.b);
    575574            if (l <= seg_length || i == pairs.size() - 1) {
    576575                // be generous on the last segment (numerical roudoff can lead to a small overshoot)
     
    594593        double length = 0.0;
    595594        for (Pair<Node, Node> p : w.getNodePairs(false)) {
    596             length += p.a.getCoor().greatCircleDistance(p.b.getCoor());
     595            length += p.a.greatCircleDistance(p.b);
    597596        }
    598597        return length;
     
    687686        Node a = w.getNode(i);
    688687        Node b = w.getNode((i + 1) % (w.getNodesCount() - 1));
    689         return a.getCoor().greatCircleDistance(b.getCoor());
     688        return a.greatCircleDistance(b);
    690689    }
    691690
Note: See TracChangeset for help on using the changeset viewer.