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/FixAddresses
Files:
3 edited

Legend:

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

    r34511 r35978  
    44    <property name="commit.message" value="[josm_fixadresses]: Fixes #josm8336"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="14153"/>
     6    <property name="plugin.main.version" value="18494"/>
    77       
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessedValueHandler.java

    r34880 r35978  
    162162
    163163        if (n.hasKey(tag)) {
    164             double dist = n.getCoor().greatCircleDistance(aNode.getCoor());
     164            double dist = n.greatCircleDistance(aNode.getCoor());
    165165            if (dist < minDist && dist < maxDist) {
    166166                minDist = dist;
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmUtils.java

    r33718 r35978  
    66
    77import org.openstreetmap.josm.data.Bounds;
     8import org.openstreetmap.josm.data.coor.ILatLon;
    89import org.openstreetmap.josm.data.coor.LatLon;
    910import org.openstreetmap.josm.data.osm.Node;
     
    4546
    4647        for (Pair<Node, Node> pair : x) {
    47             LatLon ap = pair.a.getCoor();
    48             LatLon bp = pair.b.getCoor();
     48            ILatLon ap = pair.a;
     49            ILatLon bp = pair.b;
    4950
    5051            double dist = findMinimum(ap, bp, coor);
     
    6465     * @return the double the minimum distance in m of the way and the node
    6566     */
    66     private static double findMinimum(LatLon a, LatLon b, LatLon c) {
     67    private static double findMinimum(ILatLon a, ILatLon b, ILatLon c) {
    6768        CheckParameterUtil.ensureParameterNotNull(c, "c");
    6869        CheckParameterUtil.ensureParameterNotNull(b, "b");
Note: See TracChangeset for help on using the changeset viewer.