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/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java

    r35964 r35978  
    109109
    110110        // get distance in meters and divide it by 100 in advance
    111         double distInMeter = w1.greatCircleDistance(w2) / 100.0;
     111        double distInMeter = w1.greatCircleDistance((ILatLon) w2) / 100.0;
    112112
    113113        // get elevation (difference)
  • applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/EleVertex.java

    r35165 r35978  
    66import java.util.List;
    77
     8import org.openstreetmap.josm.data.coor.ILatLon;
    89import org.openstreetmap.josm.data.coor.LatLon;
    910import org.openstreetmap.josm.plugins.elevation.ElevationHelper;
     
    4142
    4243        // compute the (approx.!) area of the vertex using heron's formula
    43         double a = p1.greatCircleDistance(p2);
    44         double b = p2.greatCircleDistance(p3);
    45         double c = p1.greatCircleDistance(p3);
     44        double a = p1.greatCircleDistance((ILatLon) p2);
     45        double b = p2.greatCircleDistance((ILatLon) p3);
     46        double c = p1.greatCircleDistance((ILatLon) p3);
    4647
    4748        double s = (a + b + c) / 2D;
     
    5556        int k = 0;
    5657        for (int i = 0; i < points.length; i++) {
    57             EleCoordinate c1 = points[i];
     58            ILatLon c1 = points[i];
    5859
    5960            for (int j = i + 1; j < points.length; j++) {
    60                 EleCoordinate c2 = points[j];
     61                ILatLon c2 = points[j];
    6162                edges[k++] = new TriangleEdge(i, j, c1.greatCircleDistance(c2));
    6263            }
     
    119120
    120121        double z = (c1.getEle() + c2.getEle()) / 2.0;
    121         if (c1.greatCircleDistance(c2) > MIN_DIST) {
     122        if (c1.greatCircleDistance((ILatLon) c2) > MIN_DIST) {
    122123            double hgtZ = ElevationHelper.getSrtmElevation(new LatLon(y, x));
    123124
Note: See TracChangeset for help on using the changeset viewer.