Changeset 16315 in osm for applications
- Timestamp:
- 2009-07-05T10:41:52+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java
r16294 r16315 366 366 public void visitBoundingBox(BoundingXYVisitor v) { 367 367 for (ImageEntry e : data) 368 v.visit(e.pos .getEastNorth());368 v.visit(e.pos); 369 369 } 370 370 -
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java
r16294 r16315 979 979 980 980 if (prevWp != null) { 981 double distance = getDistance(prevWp, curWp);981 double distance = prevWp.getCoor().greatCircleDistance(curWp.getCoor()); 982 982 // This is in km/h, 3.6 * m/s 983 983 if (curDateWp > prevDateWp) … … 1154 1154 } 1155 1155 } 1156 1157 /** Return the distance in meters between 2 points1158 * Formula and earth radius from : http://en.wikipedia.org/wiki/Great-circle_distance */1159 public double getDistance(WayPoint p1, WayPoint p2) {1160 double p1Lat = p1.getCoor().lat() * Math.PI / 180;1161 double p1Lon = p1.getCoor().lon() * Math.PI / 180;1162 double p2Lat = p2.getCoor().lat() * Math.PI / 180;1163 double p2Lon = p2.getCoor().lon() * Math.PI / 180;1164 double ret = Math.atan2(Math.sqrt(Math.pow(Math.cos(p2Lat) * Math.sin(p2Lon - p1Lon), 2)1165 + Math.pow(Math.cos(p1Lat) * Math.sin(p2Lat)1166 - Math.sin(p1Lat) * Math.cos(p2Lat) * Math.cos(p2Lon - p1Lon), 2)),1167 Math.sin(p1Lat) * Math.sin(p2Lat)1168 + Math.cos(p1Lat) * Math.cos(p2Lat) * Math.cos(p2Lon - p1Lon))1169 * 6372795; // Earth radius, in meters1170 return ret;1171 }1172 1156 }
Note:
See TracChangeset
for help on using the changeset viewer.