Changeset 35978 in osm for applications/editors/josm/plugins
- Timestamp:
- 2022-06-15T20:10:48+02:00 (3 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ColumbusCSV/build.xml
r35948 r35978 4 4 <property name="commit.message" value="Commit message"/> 5 5 <!-- Enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 7715"/>6 <property name="plugin.main.version" value="18494"/> 7 7 8 8 <!-- Plugin meta data --> -
applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/WayPointHelper.java
r34496 r35978 59 59 60 60 public static double getLonDist(WayPoint w1, WayPoint w2) { 61 LatLon ll = new LatLon(w1. getCoor().lat(), w2.getCoor().lon());62 return w1.g etCoor().greatCircleDistance(ll);61 LatLon ll = new LatLon(w1.lat(), w2.lon()); 62 return w1.greatCircleDistance(ll); 63 63 } 64 64 65 65 public static double getLatDist(WayPoint w1, WayPoint w2) { 66 LatLon ll = new LatLon(w2. getCoor().lat(), w1.getCoor().lon());67 return w1.g etCoor().greatCircleDistance(ll);66 LatLon ll = new LatLon(w2.lat(), w1.lon()); 67 return w1.greatCircleDistance(ll); 68 68 } 69 69 -
applications/editors/josm/plugins/CommandLine/build.xml
r35937 r35978 4 4 <property name="commit.message" value="JOSM/CommandLine: fix exception after JOSM update"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 7749"/>6 <property name="plugin.main.version" value="18494"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/CommandLine/src/org/openstreetmap/josm/plugins/commandline/LengthAction.java
r35976 r35978 20 20 import org.openstreetmap.josm.actions.mapmode.MapMode; 21 21 import org.openstreetmap.josm.data.Bounds; 22 import org.openstreetmap.josm.data.coor.ILatLon; 22 23 import org.openstreetmap.josm.data.coor.LatLon; 23 24 import org.openstreetmap.josm.data.osm.Node; … … 149 150 150 151 private void drawingFinish() { 151 parentPlugin.loadParameter(String.valueOf(startCoor.greatCircleDistance( endCoor)), true);152 parentPlugin.loadParameter(String.valueOf(startCoor.greatCircleDistance((ILatLon) endCoor)), true); 152 153 drawStartPos = null; 153 154 drawing = false; … … 191 192 endCoor = map.mapView.getLatLon(drawEndPos.x, drawEndPos.y); 192 193 if (drawing) { 193 map.statusLine.setDist(startCoor.greatCircleDistance( endCoor));194 map.statusLine.setDist(startCoor.greatCircleDistance((ILatLon) endCoor)); 194 195 map.mapView.repaint(); 195 196 } -
applications/editors/josm/plugins/ElevationProfile/build.xml
r35221 r35978 4 4 <property name="commit.message" value="[josm_elevationprofile]"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 5502"/>6 <property name="plugin.main.version" value="18494"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java
r35964 r35978 109 109 110 110 // 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; 112 112 113 113 // get elevation (difference) -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/EleVertex.java
r35165 r35978 6 6 import java.util.List; 7 7 8 import org.openstreetmap.josm.data.coor.ILatLon; 8 9 import org.openstreetmap.josm.data.coor.LatLon; 9 10 import org.openstreetmap.josm.plugins.elevation.ElevationHelper; … … 41 42 42 43 // 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); 46 47 47 48 double s = (a + b + c) / 2D; … … 55 56 int k = 0; 56 57 for (int i = 0; i < points.length; i++) { 57 EleCoordinatec1 = points[i];58 ILatLon c1 = points[i]; 58 59 59 60 for (int j = i + 1; j < points.length; j++) { 60 EleCoordinatec2 = points[j];61 ILatLon c2 = points[j]; 61 62 edges[k++] = new TriangleEdge(i, j, c1.greatCircleDistance(c2)); 62 63 } … … 119 120 120 121 double z = (c1.getEle() + c2.getEle()) / 2.0; 121 if (c1.greatCircleDistance( c2) > MIN_DIST) {122 if (c1.greatCircleDistance((ILatLon) c2) > MIN_DIST) { 122 123 double hgtZ = ElevationHelper.getSrtmElevation(new LatLon(y, x)); 123 124 -
applications/editors/josm/plugins/FastDraw/build.xml
r35860 r35978 4 4 <property name="commit.message" value="[josm_fastdraw] Fix incorrect settings saving-2"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="18 173"/>6 <property name="plugin.main.version" value="18494"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/DrawnPolyLine.java
r34949 r35978 10 10 import java.util.Set; 11 11 12 import org.openstreetmap.josm.data.coor.ILatLon; 12 13 import org.openstreetmap.josm.data.coor.LatLon; 13 14 import org.openstreetmap.josm.gui.MapView; … … 38 39 List<LatLon> pts = getPoints(); 39 40 Iterator<LatLon> it1, it2; 40 LatLon pp1, pp2;41 ILatLon pp1, pp2; 41 42 if (pts.size() < 2) return 0; 42 43 it1 = pts.listIterator(0); … … 368 369 if (k > n) k = n; 369 370 370 LatLon pp1, pp2 = null;371 ILatLon pp1, pp2 = null; 371 372 Iterator<LatLon> it1, it2; 372 373 it1 = pts.listIterator(0); -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java
r35864 r35978 560 560 // there may be a node with the same coords! 561 561 562 if (nd != null && p.greatCircleDistance(nd .getCoor()) > 0.01) nd = null;562 if (nd != null && p.greatCircleDistance(nd) > 0.01) nd = null; 563 563 if (nd == null) { 564 564 if (i > 0 && p.equals(first)) { -
applications/editors/josm/plugins/FixAddresses/build.xml
r34511 r35978 4 4 <property name="commit.message" value="[josm_fixadresses]: Fixes #josm8336"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 4153"/>6 <property name="plugin.main.version" value="18494"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessedValueHandler.java
r34880 r35978 162 162 163 163 if (n.hasKey(tag)) { 164 double dist = n.g etCoor().greatCircleDistance(aNode.getCoor());164 double dist = n.greatCircleDistance(aNode.getCoor()); 165 165 if (dist < minDist && dist < maxDist) { 166 166 minDist = dist; -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmUtils.java
r33718 r35978 6 6 7 7 import org.openstreetmap.josm.data.Bounds; 8 import org.openstreetmap.josm.data.coor.ILatLon; 8 9 import org.openstreetmap.josm.data.coor.LatLon; 9 10 import org.openstreetmap.josm.data.osm.Node; … … 45 46 46 47 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; 49 50 50 51 double dist = findMinimum(ap, bp, coor); … … 64 65 * @return the double the minimum distance in m of the way and the node 65 66 */ 66 private static double findMinimum( LatLon a, LatLon b,LatLon c) {67 private static double findMinimum(ILatLon a, ILatLon b, ILatLon c) { 67 68 CheckParameterUtil.ensureParameterNotNull(c, "c"); 68 69 CheckParameterUtil.ensureParameterNotNull(b, "b"); -
applications/editors/josm/plugins/MicrosoftStreetside/gradle.properties
r35816 r35978 8 8 # Minimum required JOSM version to run this plugin, choose the lowest version possible that is compatible. 9 9 # You can check if the plugin compiles against this version by executing `./gradlew compileJava_minJosm`. 10 plugin.main.version=18 00410 plugin.main.version=18494 11 11 #plugin.version= 12 12 # Version of JOSM against which the plugin is compiled 13 13 # Please check, if the specified version is available for download from https://josm.openstreetmap.de/download/ . 14 14 # If not, choose the next higher number that is available, or the gradle build will break. 15 plugin.compile.version=18 00415 plugin.compile.version=18494 16 16 plugin.requires=apache-commons;apache-http;utilsplugin2;javafx 17 17 -
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideLayer.java
r35601 r35978 23 23 import org.apache.log4j.Logger; 24 24 import org.openstreetmap.josm.data.Bounds; 25 import org.openstreetmap.josm.data.coor.ILatLon; 25 26 import org.openstreetmap.josm.data.osm.DataSet; 26 27 import org.openstreetmap.josm.data.osm.event.DataChangedEvent; … … 462 463 .filter(img -> // Filters out images too far away from target 463 464 img != null && 464 img.getMovingLatLon().greatCircleDistance( target.getMovingLatLon())465 img.getMovingLatLon().greatCircleDistance((ILatLon) target.getMovingLatLon()) 465 466 < StreetsideProperties.SEQUENCE_MAX_JUMP_DISTANCE.get() 466 467 ) … … 501 502 public int compare(StreetsideAbstractImage img1, StreetsideAbstractImage img2) { 502 503 return (int) Math.signum( 503 img1.getMovingLatLon().greatCircleDistance( target.getMovingLatLon()) -504 img2.getMovingLatLon().greatCircleDistance( target.getMovingLatLon())504 img1.getMovingLatLon().greatCircleDistance((ILatLon) target.getMovingLatLon()) - 505 img2.getMovingLatLon().greatCircleDistance((ILatLon) target.getMovingLatLon()) 505 506 ); 506 507 } -
applications/editors/josm/plugins/NanoLog/build.xml
r35221 r35978 5 5 <property name="commit.message" value="NanoLog"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 5502"/>7 <property name="plugin.main.version" value="18494"/> 8 8 <property name="plugin.author" value="Ilya Zverev"/> 9 9 <property name="plugin.class" value="nanolog.NanoLogPlugin"/> -
applications/editors/josm/plugins/NanoLog/src/nanolog/Correlator.java
r35221 r35978 131 131 Integer direction = null; 132 132 if (prevWp != null) { 133 direction = Long.valueOf(Math.round(180.0 / Math.PI * -prevWp. getCoor().bearing(curWp.getCoor()))).intValue();133 direction = Long.valueOf(Math.round(180.0 / Math.PI * -prevWp.bearing(curWp))).intValue(); 134 134 } 135 135 -
applications/editors/josm/plugins/addrinterpolation/build.xml
r34487 r35978 4 4 <property name="commit.message" value="Impoved Icon"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 4153"/>6 <property name="plugin.main.version" value="18494"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java
r34658 r35978 826 826 for (int segment = 0; segment < nSegments; segment++) { 827 827 Node toNode = addrInterpolationWay.getNode(startNodeIndex + 1 + segment); 828 segmentLengths[segment] = fromNode.g etCoor().greatCircleDistance(toNode.getCoor());828 segmentLengths[segment] = fromNode.greatCircleDistance(toNode); 829 829 totalLength += segmentLengths[segment]; 830 830 -
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/AngleSnap.java
r34850 r35978 25 25 public final Double addSnap(Node[] nodes) { 26 26 if (nodes.length == 2) { 27 EastNorth p1 = latlon2eastNorth(nodes[0] .getCoor());28 EastNorth p2 = latlon2eastNorth(nodes[1] .getCoor());27 EastNorth p1 = latlon2eastNorth(nodes[0]); 28 EastNorth p2 = latlon2eastNorth(nodes[1]); 29 29 double heading = p1.heading(p2); 30 30 addSnap(heading); … … 38 38 public final void addSnap(Way way) { 39 39 for (Pair<Node, Node> pair : way.getNodePairs(false)) { 40 EastNorth a = latlon2eastNorth(pair.a .getCoor());41 EastNorth b = latlon2eastNorth(pair.b .getCoor());40 EastNorth a = latlon2eastNorth(pair.a); 41 EastNorth b = latlon2eastNorth(pair.b); 42 42 double heading = a.heading(b); 43 43 addSnap(heading); -
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/BuildingsToolsPlugin.java
r34572 r35978 5 5 6 6 import org.openstreetmap.josm.data.coor.EastNorth; 7 import org.openstreetmap.josm.data.coor.ILatLon; 7 8 import org.openstreetmap.josm.data.coor.LatLon; 8 9 import org.openstreetmap.josm.data.projection.Projection; … … 18 19 public static final Projection MERCATOR = Projections.getProjectionByCode("EPSG:3857"); // Mercator 19 20 20 public static EastNorth latlon2eastNorth( LatLon p) {21 public static EastNorth latlon2eastNorth(ILatLon p) { 21 22 return MERCATOR.latlon2eastNorth(p); 22 23 } -
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/DrawBuildingAction.java
r35929 r35978 210 210 Node n = MainApplication.getMap().mapView.getNearestNode(mousePos, OsmPrimitive::isUsable); 211 211 if (n != null) 212 return latlon2eastNorth(n .getCoor());212 return latlon2eastNorth(n); 213 213 IWaySegment<Node, Way> ws = MainApplication.getMap().mapView.getNearestWaySegment(mousePos, 214 214 OsmPrimitive::isSelectable); 215 215 if (ws != null && ws.getWay().get("building") != null) { 216 EastNorth p1 = latlon2eastNorth(ws.getFirstNode() .getCoor());217 EastNorth p2 = latlon2eastNorth(ws.getSecondNode() .getCoor());216 EastNorth p1 = latlon2eastNorth(ws.getFirstNode()); 217 EastNorth p2 = latlon2eastNorth(ws.getSecondNode()); 218 218 EastNorth enX = Geometry.closestPointToSegment(p1, p2, 219 219 latlon2eastNorth(MainApplication.getMap().mapView.getLatLon(mousePos.x, mousePos.y))); -
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/ToolSettings.java
r35915 r35978 98 98 } else { 99 99 ToolSettings.shape = Shape.RECTANGLE; 100 return (Shape.RECTANGLE);100 return Shape.RECTANGLE; 101 101 } 102 102 } -
applications/editors/josm/plugins/geochat/build.xml
r35162 r35978 5 5 <property name="commit.message" value="[josm_geochat] copypaste from keyboard, font size advanced parameters"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 5389"/>7 <property name="plugin.main.version" value="18494"/> 8 8 9 9 <property name="plugin.author" value="Ilya Zverev"/> -
applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java
r35162 r35978 19 19 import javax.json.JsonObject; 20 20 21 import org.openstreetmap.josm.data.coor.ILatLon; 21 22 import org.openstreetmap.josm.data.coor.LatLon; 22 23 import org.openstreetmap.josm.data.coor.conversion.DecimalDegreesCoordinateFormat; … … 349 350 final boolean needReset; 350 351 final boolean needFullReset = lastUserId != userId; 351 if (needFullReset || (lastPosition != null && pos.greatCircleDistance( lastPosition) > MAX_JUMP)) {352 if (needFullReset || (lastPosition != null && pos.greatCircleDistance((ILatLon) lastPosition) > MAX_JUMP)) { 352 353 // reset messages 353 354 lastId = 0; -
applications/editors/josm/plugins/imagery_offset_db/build.xml
r34641 r35978 5 5 <property name="commit.message" value="Imagery Offset Database"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 4221"/>7 <property name="plugin.main.version" value="18494"/> 8 8 <property name="plugin.canloadatruntime" value="true"/> 9 9 -
applications/editors/josm/plugins/imagery_offset_db/src/org/openstreetmap/josm/plugins/imagery_offset_db/ImageryOffsetWatcher.java
r34596 r35978 11 11 import java.util.TreeMap; 12 12 13 import org.openstreetmap.josm.data.coor.ILatLon; 13 14 import org.openstreetmap.josm.data.coor.LatLon; 14 15 import org.openstreetmap.josm.data.imagery.OffsetBookmark; … … 151 152 setOffsetGood(true); 152 153 } else { 153 setOffsetGood(data.lastChecked != null && center.greatCircleDistance( data.lastChecked) <= maxDistance * 1000);154 setOffsetGood(data.lastChecked != null && center.greatCircleDistance((ILatLon) data.lastChecked) <= maxDistance * 1000); 154 155 } 155 156 } … … 264 265 continue; 265 266 } 266 LatLon lastPos = new LatLon(dparts[0], dparts[1]);267 ILatLon lastPos = new LatLon(dparts[0], dparts[1]); 267 268 if (lastPos.greatCircleDistance(ImageryOffsetTools.getMapCenter()) < Math.max(maxDistance, 3.0) * 1000) { 268 269 // apply offset -
applications/editors/josm/plugins/imagery_offset_db/src/org/openstreetmap/josm/plugins/imagery_offset_db/OffsetDialogButton.java
r34596 r35978 26 26 27 27 import org.openstreetmap.josm.data.coor.EastNorth; 28 import org.openstreetmap.josm.data.coor.ILatLon; 28 29 import org.openstreetmap.josm.data.coor.LatLon; 29 30 import org.openstreetmap.josm.data.projection.Projection; … … 68 69 */ 69 70 public void updateLocation() { 70 LatLon center = ImageryOffsetTools.getMapCenter();71 ILatLon center = ImageryOffsetTools.getMapCenter(); 71 72 directionArrow.updateIcon(center); 72 73 double distance = center.greatCircleDistance(offset.getPosition()); … … 151 152 Projection proj = ProjectionRegistry.getProjection(); 152 153 EastNorth pos = proj.latlon2eastNorth(offset.getPosition()); 153 LatLon correctedCenterLL = proj.eastNorth2latlon(pos.add(-dx, -dy));154 ILatLon correctedCenterLL = proj.eastNorth2latlon(pos.add(-dx, -dy)); 154 155 double length = correctedCenterLL.greatCircleDistance(offset.getImageryPos()); 155 156 double direction = length < 1e-2 ? 0.0 : -correctedCenterLL.bearing(offset.getImageryPos()); … … 261 262 } 262 263 263 public void updateIcon( LatLon from) {264 public void updateIcon(ILatLon from) { 264 265 distance = from.greatCircleDistance(to); 265 266 direction = -to.bearing(from); -
applications/editors/josm/plugins/imagery_offset_db/src/org/openstreetmap/josm/plugins/imagery_offset_db/OffsetInfoAction.java
r34596 r35978 12 12 import javax.swing.JOptionPane; 13 13 14 import org.openstreetmap.josm.data.coor.ILatLon; 14 15 import org.openstreetmap.josm.gui.MainApplication; 15 16 import org.openstreetmap.josm.tools.ImageProvider; … … 80 81 StringBuilder sb = new StringBuilder(); 81 82 if (offset instanceof ImageryOffset) { 82 double odist = ((ImageryOffset) offset).getImageryPos().greatCircleDistance( offset.getPosition());83 double odist = ((ImageryOffset) offset).getImageryPos().greatCircleDistance((ILatLon) offset.getPosition()); 83 84 if (odist < 1e-2) odist = 0.0; 84 85 sb.append(tr("An imagery offset of {0}", ImageryOffsetTools.formatDistance(odist))).append('\n'); … … 88 89 } 89 90 90 double dist = ImageryOffsetTools.getMapCenter().greatCircleDistance( offset.getPosition());91 double dist = ImageryOffsetTools.getMapCenter().greatCircleDistance((ILatLon) offset.getPosition()); 91 92 sb.append(dist < 50 ? tr("Determined right here") : tr("Determined {0} away", 92 93 ImageryOffsetTools.formatDistance(dist))); -
applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/CorridorGeography.java
r32601 r35978 4 4 import java.util.Vector; 5 5 6 import org.openstreetmap.josm.data.coor.ILatLon; 6 7 import org.openstreetmap.josm.data.coor.LatLon; 7 8 import org.openstreetmap.josm.data.osm.DataSet; … … 17 18 private static final double MIN_LENGTH = 10.; 18 19 19 private void setExtraElements(CorridorPart.ReachableSide side, LatLon from,LatLon to,20 private void setExtraElements(CorridorPart.ReachableSide side, ILatLon from, ILatLon to, 20 21 boolean extraWayUp, double minLength) { 21 22 LatLon middleCoor = new LatLon((from.lat() + to.lat())/2., … … 27 28 middleNode.setCoor(middleCoor); 28 29 29 LatLon start = from;30 ILatLon start = from; 30 31 if (side == CorridorPart.ReachableSide.LEFT) { 31 32 if (middleCoor.lat() < start.lat()) … … 71 72 72 73 public void appendNodes(CorridorPart.Type type, CorridorPart.ReachableSide side, String level, 73 LatLon from,LatLon to, ModelGeography target) {74 ILatLon from, ILatLon to, ModelGeography target) { 74 75 if (type == CorridorPart.Type.STAIRS_UP || type == CorridorPart.Type.STAIRS_DOWN) { 75 76 setExtraElements(side, from, to, type == CorridorPart.Type.STAIRS_UP, MIN_LENGTH); -
applications/editors/josm/plugins/indoor_sweepline/src/indoor_sweepline/ModelGeography.java
r32601 r35978 85 85 86 86 public void finishWay(Strip strip, int partIndex, boolean isOuter, String level) { 87 if ( nodes.size() > 0) {87 if (!nodes.isEmpty()) { 88 88 CorridorPart part = strip.partAt(partIndex); 89 89 strip.geographyAt(partIndex).appendNodes(part.getType(), part.getSide(), level, 90 nodes.elementAt(nodes.size()-1) .getCoor(), nodes.elementAt(0).getCoor(), this);90 nodes.elementAt(nodes.size()-1), nodes.elementAt(0), this); 91 91 nodes.add(nodes.elementAt(0)); 92 92 } … … 98 98 public void appendCorridorPart(CorridorPart part, CorridorGeography partGeography, int beamIndex, int partIndex, 99 99 String level) { 100 if ( nodes.size() > 0)100 if (!nodes.isEmpty()) 101 101 partGeography.appendNodes(part.getType(), part.getSide(), level, 102 nodes.elementAt(nodes.size()-1) .getCoor(),102 nodes.elementAt(nodes.size()-1), 103 103 beamsGeography.elementAt(beamIndex).coorAt(partIndex), this); 104 104 } … … 113 113 0, strip.width / 2.)); 114 114 115 if ( nodes.size() > 0) {115 if (!nodes.isEmpty()) { 116 116 CorridorPart part = strip.partAt(partIndex); 117 117 strip.geographyAt(partIndex).appendNodes(part.getType(), part.getSide(), level, 118 nodes.elementAt(nodes.size()-1) .getCoor(), nodePool.elementAt(nodePoolCount).getCoor(), this);118 nodes.elementAt(nodes.size()-1), nodePool.elementAt(nodePoolCount), this); 119 119 } 120 120 nodes.add(nodePool.elementAt(nodePoolCount)); … … 183 183 private void adjustMultipolygonRelation(IndoorSweeplineModel.Type type, String level) { 184 184 if (members.size() > 1) { 185 if ( wayPool.size() > 0)185 if (!wayPool.isEmpty()) 186 186 wayPool.elementAt(0).removeAll(); 187 187 -
applications/editors/josm/plugins/infomode/build.xml
r35221 r35978 5 5 <property name="commit.message" value="InfoMode : for shortcurt parser"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 5502"/>7 <property name="plugin.main.version" value="18494"/> 8 8 9 9 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoMode.java
r35221 r35978 289 289 double vel = -1; 290 290 if (prevWp != null && wp.getTimeInMillis() != prevWp.getTimeInMillis()) { 291 vel = wp.g etCoor().greatCircleDistance(prevWp.getCoor())/291 vel = wp.greatCircleDistance(prevWp)/ 292 292 (wp.getTime()-prevWp.getTime()); 293 293 } -
applications/editors/josm/plugins/livegps/src/livegps/AppendableGpxTrackSegment.java
r35221 r35978 39 39 40 40 if (size > 0) { 41 Double distance = wayPoints[size - 1].getCoor().greatCircleDistance(p.getCoor());42 if (! distance.isNaN() && !distance.isInfinite()) {41 double distance = wayPoints[size - 1].greatCircleDistance(p); 42 if (!Double.isNaN(distance) && !Double.isInfinite(distance)) { 43 43 length += distance; 44 44 } -
applications/editors/josm/plugins/measurement/build.xml
r35221 r35978 4 4 <property name="commit.message" value="recompile dure to core change"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 5502"/>6 <property name="plugin.main.version" value="18494"/> 7 7 <property name="plugin.canloadatruntime" value="true"/> 8 8 -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java
r35976 r35978 204 204 } else { 205 205 for (Node n : nodes) { 206 if (n. getCoor() != null) {206 if (n.isLatLonKnown()) { 207 207 if (lastNode == null) { 208 208 lastNode = n; 209 209 } else { 210 length += lastNode.g etCoor().greatCircleDistance(n.getCoor());210 length += lastNode.greatCircleDistance(n); 211 211 segAngle = MeasurementLayer.angleBetween(lastNode, n); 212 212 lastNode = n; … … 223 223 boolean isCircle = true; 224 224 for (Node n: w.getNodes()) { 225 if (lastN != null && lastN. getCoor() != null && n.getCoor() != null) {226 final double segLength = lastN.g etCoor().greatCircleDistance(n.getCoor());225 if (lastN != null && lastN.isLatLonKnown() && n.isLatLonKnown()) { 226 final double segLength = lastN.greatCircleDistance(n); 227 227 if (firstSegLength == null) { 228 228 firstSegLength = segLength; … … 233 233 length += segLength; 234 234 //http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/ 235 wayArea += (MeasurementLayer.calcX(n .getCoor()) * MeasurementLayer.calcY(lastN.getCoor()))236 - (MeasurementLayer.calcY(n .getCoor()) * MeasurementLayer.calcX(lastN.getCoor()));235 wayArea += (MeasurementLayer.calcX(n) * MeasurementLayer.calcY(lastN)) 236 - (MeasurementLayer.calcY(n) * MeasurementLayer.calcX(lastN)); 237 237 segAngle = MeasurementLayer.angleBetween(lastN, n); 238 238 } -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java
r35976 r35978 157 157 * https://stackoverflow.com/questions/4681737/how-to-calculate-the-area-of-a-polygon-on-the-earths-surface-using-python 158 158 */ 159 public static double calcX( LatLon p1){159 public static double calcX(ILatLon p1){ 160 160 return p1.lat() * Math.PI * 6367000 / 180; 161 161 } 162 162 163 public static double calcY( LatLon p1){163 public static double calcY(ILatLon p1){ 164 164 return p1.lon() * ( Math.PI * 6367000 / 180) * Math.cos(p1.lat() * Math.PI / 180); 165 165 } 166 166 167 167 public static double calcDistance(WayPoint p1, WayPoint p2){ 168 return p1.g etCoor().greatCircleDistance(p2.getCoor());168 return p1.greatCircleDistance(p2); 169 169 } 170 170 -
applications/editors/josm/plugins/opendata/build.xml
r35975 r35978 1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <project name="opendata" default="dist" basedir="."> 3 <property name="plugin.main.version" value="184 64"/>3 <property name="plugin.main.version" value="18494"/> 4 4 <property name="plugin.author" value="Don-vip"/> 5 5 <property name="plugin.class" value="org.openstreetmap.josm.plugins.opendata.OdPlugin"/> -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NeptuneReader.java
r34384 r35978 23 23 import javax.xml.validation.Validator; 24 24 25 import org.openstreetmap.josm.data.coor.ILatLon; 25 26 import org.openstreetmap.josm.data.coor.LatLon; 26 27 import org.openstreetmap.josm.data.osm.DataSet; … … 239 240 } 240 241 241 protected static final boolean isNullLatLon(LatLon ll) {242 protected static boolean isNullLatLon(ILatLon ll) { 242 243 return ll.lat() == 0.0 && ll.lon() == 0.0; 243 244 } … … 362 363 for (RelationMember member : stopArea.getMembers()) { 363 364 // Fix stop coordinates if needed 364 if (member.getRole().equals(OSM_PLATFORM) && isNullLatLon(member.getNode() .getCoor())) {365 if (member.getRole().equals(OSM_PLATFORM) && isNullLatLon(member.getNode())) { 365 366 member.getNode().setCoor(createLatLon(areaCentroid)); 366 367 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetReader.java
r34452 r35978 253 253 firstNode = n; 254 254 } 255 if (n == firstNode || n.g etCoor().greatCircleDistance(firstNode.getCoor())255 if (n == firstNode || n.greatCircleDistance(firstNode) 256 256 > Config.getPref().getDouble(OdConstants.PREF_TOLERANCE, OdConstants.DEFAULT_TOLERANCE)) { 257 257 ds.addPrimitive(n); -
applications/editors/josm/plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/io/PbfWriter.java
r35825 r35978 12 12 13 13 import org.openstreetmap.josm.data.DataSource; 14 import org.openstreetmap.josm.data.coor.LatLon;15 14 import org.openstreetmap.josm.data.osm.DataSet; 16 15 import org.openstreetmap.josm.data.osm.Node; … … 200 199 bi.addId(id - lastid); 201 200 lastid = id; 202 LatLon coor = i.getCoor(); 203 if (coor != null) { 204 int lat = mapDegrees(coor.lat()); 205 int lon = mapDegrees(coor.lon()); 201 if (i.isLatLonKnown()) { 202 int lat = mapDegrees(i.lat()); 203 int lon = mapDegrees(i.lon()); 206 204 bi.addLon(lon - lastlon); 207 205 lastlon = lon; … … 235 233 for (Node i : contents) { 236 234 long id = i.getUniqueId(); 237 LatLon coor = i.getCoor(); 238 int lat = mapDegrees(coor.lat()); 239 int lon = mapDegrees(coor.lon()); 235 int lat = mapDegrees(i.lat()); 236 int lon = mapDegrees(i.lon()); 240 237 Osmformat.Node.Builder bi = Osmformat.Node.newBuilder(); 241 238 bi.setId(id); … … 385 382 nodes = new NodeGroup(); 386 383 } 387 if (node. getCoor() != null) {384 if (node.isLatLonKnown()) { 388 385 nodes.add(node); 389 386 checkLimit(); -
applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustWorker.java
r35108 r35978 7 7 import org.openstreetmap.josm.data.ImageData; 8 8 import org.openstreetmap.josm.data.coor.EastNorth; 9 import org.openstreetmap.josm.data.coor.ILatLon; 9 10 import org.openstreetmap.josm.data.coor.LatLon; 10 11 import org.openstreetmap.josm.data.projection.ProjectionRegistry; … … 226 227 private void changeDirection(ImageEntry photo, ImageData data, 227 228 MouseEvent evt) { 228 final LatLon photoLL = photo.getPos();229 final ILatLon photoLL = photo.getPos(); 229 230 if (photoLL == null) { 230 231 // Direction cannot be set if image doesn't have a position. -
applications/editors/josm/plugins/public_transport/build.xml
r35221 r35978 5 5 <property name="commit.message" value="Commit message"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 5502"/>7 <property name="plugin.main.version" value="18494"/> 8 8 9 9 <property name="plugin.author" value="Roland M. Olbricht"/> -
applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/PublicTransportAStar.java
r34718 r35978 70 70 double totalDistance = 0; 71 71 for (int i = min; i < max; ++i) { 72 totalDistance += way.getNode(i).g etCoor().greatCircleDistance(way.getNode(i + 1).getCoor());72 totalDistance += way.getNode(i).greatCircleDistance(way.getNode(i + 1)); 73 73 } 74 74 return totalDistance; … … 138 138 public double estimateDistance(AStarAlgorithm.Vertex vertex) { 139 139 NodeVertex nodeVertex = (NodeVertex) vertex; 140 return ((NodeVertex) super.end).node .getCoor()141 .greatCircleDistance(nodeVertex.node .getCoor());140 return ((NodeVertex) super.end).node 141 .greatCircleDistance(nodeVertex.node); 142 142 } 143 143 } -
applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/commands/TrackSuggestStopsCommand.java
r35219 r35978 9 9 10 10 import org.openstreetmap.josm.command.Command; 11 import org.openstreetmap.josm.data.coor.ILatLon; 11 12 import org.openstreetmap.josm.data.coor.LatLon; 12 13 import org.openstreetmap.josm.data.gpx.IGpxTrackSegment; … … 121 122 if (j < k) { 122 123 double dist = 0; 123 LatLon latLonI = wayPoints.elementAt(i).getCoor();124 ILatLon latLonI = wayPoints.elementAt(i).getCoor(); 124 125 for (int l = j; l < k; ++l) { 125 double distL = latLonI.greatCircleDistance(wayPoints.elementAt(l) .getCoor());126 double distL = latLonI.greatCircleDistance(wayPoints.elementAt(l)); 126 127 if (distL > dist) 127 128 dist = distL; … … 148 149 149 150 LatLon latLon = wayPoints.elementAt(i).getCoor(); 150 if ((lastStopCoor != null) && (lastStopCoor.greatCircleDistance( latLon) < threshold))151 if ((lastStopCoor != null) && (lastStopCoor.greatCircleDistance((ILatLon) latLon) < threshold)) 151 152 continue; 152 153 -
applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/models/GTFSStopTableModel.java
r34718 r35978 180 180 while (iter.hasNext()) { 181 181 Node node = iter.next(); 182 if (coor.greatCircleDistance(node .getCoor()) < 1000) {182 if (coor.greatCircleDistance(node) < 1000) { 183 183 nearBusStop = true; 184 184 break; -
applications/editors/josm/plugins/routing/build.xml
r35039 r35978 5 5 <property name="commit.message" value="added one-way support in roundabouts"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 4153"/>7 <property name="plugin.main.version" value="18494"/> 8 8 9 9 <property name="plugin.author" value="Jose Vidal <vidalfree@gmail.com>, Juangui Jordán <juangui@gmail.com>, Hassan S <hassan.sabirin@gmail.com>"/> -
applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmEdge.java
r32768 r35978 41 41 this.from = from; 42 42 this.to = to; 43 this.length = from.g etCoor().greatCircleDistance(to.getCoor());43 this.length = from.greatCircleDistance(to); 44 44 } 45 45 -
applications/editors/josm/plugins/simplifyarea/build.xml
r34586 r35978 4 4 <property name="commit.message" value="Initial commit"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 4153"/>6 <property name="plugin.main.version" value="18494"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/simplifyarea/src/org/openstreetmap/josm/plugins/simplifyarea/SimplifyAreaAction.java
r35976 r35978 29 29 import org.openstreetmap.josm.data.Bounds; 30 30 import org.openstreetmap.josm.data.UndoRedoHandler; 31 import org.openstreetmap.josm.data.coor.ILatLon; 31 32 import org.openstreetmap.josm.data.coor.LatLon; 32 33 import org.openstreetmap.josm.data.osm.Node; … … 257 258 } 258 259 259 final LatLon a = coordMap.get(n1);260 final LatLon b = coordMap.get(n2);260 final ILatLon a = coordMap.get(n1); 261 final ILatLon b = coordMap.get(n2); 261 262 262 263 if (a != null && b != null) { … … 419 420 } 420 421 421 public static double computeConvectAngle(final LatLon coord1, final LatLon coord2, finalLatLon coord3) {422 public static double computeConvectAngle(final ILatLon coord1, final ILatLon coord2, final ILatLon coord3) { 422 423 final double angle = Math.abs(heading(coord2, coord3) - heading(coord1, coord2)); 423 424 return Math.toDegrees(angle < Math.PI ? angle : 2 * Math.PI - angle); 424 425 } 425 426 426 public static double computeArea(final LatLon coord1, final LatLon coord2, finalLatLon coord3) {427 public static double computeArea(final ILatLon coord1, final ILatLon coord2, final ILatLon coord3) { 427 428 final double a = coord1.greatCircleDistance(coord2); 428 429 final double b = coord2.greatCircleDistance(coord3); … … 437 438 public static double R = 6378135; 438 439 439 public static double crossTrackError(final LatLon l1, final LatLon l2, finalLatLon l3) {440 public static double crossTrackError(final ILatLon l1, final ILatLon l2, final ILatLon l3) { 440 441 return R * Math.asin(sin(l1.greatCircleDistance(l2) / R) * sin(heading(l1, l2) - heading(l1, l3))); 441 442 } 442 443 443 public static double heading(final LatLon a, finalLatLon b) {444 public static double heading(final ILatLon a, final ILatLon b) { 444 445 double hd = Math.atan2(sin(toRadians(a.lon() - b.lon())) * cos(toRadians(b.lat())), 445 446 cos(toRadians(a.lat())) * sin(toRadians(b.lat())) - -
applications/editors/josm/plugins/terracer/build.xml
r35975 r35978 2 2 <project name="terracer" default="dist" basedir="."> 3 3 <property name="commit.message" value="applied #j5760 (patch by robome) - Order of housenumbers not correct"/> 4 <property name="plugin.main.version" value="184 64"/>4 <property name="plugin.main.version" value="18494"/> 5 5 <property name="plugin.author" value="Matt Amos"/> 6 6 <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 33 33 import org.openstreetmap.josm.data.UndoRedoHandler; 34 34 import org.openstreetmap.josm.data.coor.ILatLon; 35 import org.openstreetmap.josm.data.coor.LatLon;36 35 import org.openstreetmap.josm.data.osm.DataSet; 37 36 import org.openstreetmap.josm.data.osm.Node; … … 572 571 for (int i = 0; i < pairs.size(); ++i) { 573 572 Pair<Node, Node> p = pairs.get(i); 574 final double seg_length = p.a.g etCoor().greatCircleDistance(p.b.getCoor());573 final double seg_length = p.a.greatCircleDistance(p.b); 575 574 if (l <= seg_length || i == pairs.size() - 1) { 576 575 // be generous on the last segment (numerical roudoff can lead to a small overshoot) … … 594 593 double length = 0.0; 595 594 for (Pair<Node, Node> p : w.getNodePairs(false)) { 596 length += p.a.g etCoor().greatCircleDistance(p.b.getCoor());595 length += p.a.greatCircleDistance(p.b); 597 596 } 598 597 return length; … … 687 686 Node a = w.getNode(i); 688 687 Node b = w.getNode((i + 1) % (w.getNodesCount() - 1)); 689 return a.g etCoor().greatCircleDistance(b.getCoor());688 return a.greatCircleDistance(b); 690 689 } 691 690 -
applications/editors/josm/plugins/tracer/src/org/openstreetmap/josm/plugins/tracer/ConnectWays.java
r35976 r35978 150 150 151 151 for (Pair<Node, Node> np : ww.getNodePairs(false)) { 152 double dist = TracerGeometry.distanceFromSegment(ll, np.a .getCoor(), np.b.getCoor());152 double dist = TracerGeometry.distanceFromSegment(ll, np.a, np.b); 153 153 if (dist < minDist) { 154 154 minDist = dist; -
applications/editors/josm/plugins/trustosm/build.xml
r35762 r35978 5 5 <property name="commit.message" value="trustosm: recompile for compatibility with JOSM r17896" /> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 7896"/>7 <property name="plugin.main.version" value="18494"/> 8 8 <property name="plugin.author" value="Christoph Wagner" /> 9 9 <property name="plugin.class" value="org.openstreetmap.josm.plugins.trustosm.TrustOSMplugin" /> -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustAnalyzer.java
r34565 r35978 95 95 Node signedNode = TrustNode.generateNodeFromSigtext(signedPlaintext); 96 96 Node currentNode = (Node) trust.getOsmPrimitive(); 97 double dist = signedNode.g etCoor().greatCircleDistance(currentNode.getCoor());97 double dist = signedNode.greatCircleDistance(currentNode); 98 98 99 99 /** is distance between signed Node and current Node inside tolerance? */ … … 157 157 Node signedNode = signedSegment.get(i); 158 158 Node currentNode = nodes.get(i); 159 double dist = signedNode.g etCoor().greatCircleDistance(currentNode.getCoor());159 double dist = signedNode.greatCircleDistance(currentNode); 160 160 if (dist > tolerance) return false; 161 161 } -
applications/editors/josm/plugins/turnlanes/build.xml
r34566 r35978 5 5 <property name="commit.message" value="fix toolbar warnings - toolbar still does not work"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 4153"/>7 <property name="plugin.main.version" value="18494"/> 8 8 9 9 <!-- -
applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiContainer.java
r35812 r35978 18 18 19 19 import org.openstreetmap.josm.data.coor.EastNorth; 20 import org.openstreetmap.josm.data.coor. LatLon;20 import org.openstreetmap.josm.data.coor.ILatLon; 21 21 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 22 22 import org.openstreetmap.josm.plugins.turnlanes.model.Junction; … … 53 53 final Point2D origin = avgOrigin(locs(mc.getPrimaryJunctions())); 54 54 55 final LatLon originCoor = ProjectionRegistry.getProjection().eastNorth2latlon(new EastNorth(origin.getX(), origin.getY()));56 final LatLon relCoor = ProjectionRegistry.getProjection().eastNorth2latlon(55 final ILatLon originCoor = ProjectionRegistry.getProjection().eastNorth2latlon(new EastNorth(origin.getX(), origin.getY())); 56 final ILatLon relCoor = ProjectionRegistry.getProjection().eastNorth2latlon( 57 57 new EastNorth(origin.getX() + 1, origin.getY() + 1)); 58 58 -
applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Route.java
r34976 r35978 52 52 Node last = nodes.get(0); 53 53 for (Node n : nodes.subList(1, nodes.size())) { 54 length += last.g etCoor().greatCircleDistance(n.getCoor());54 length += last.greatCircleDistance(n); 55 55 last = n; 56 56 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CircleArcMaker.java
r35624 r35978 22 22 import org.openstreetmap.josm.data.UndoRedoHandler; 23 23 import org.openstreetmap.josm.data.coor.EastNorth; 24 import org.openstreetmap.josm.data.coor. LatLon;24 import org.openstreetmap.josm.data.coor.ILatLon; 25 25 import org.openstreetmap.josm.data.coor.PolarCoor; 26 26 import org.openstreetmap.josm.data.osm.DataSet; … … 108 108 109 109 // see #10777: calculate reasonable number of nodes for full circle (copy from CreateCircleAction) 110 LatLon ll1 = ProjectionRegistry.getProjection().eastNorth2latlon(p1);111 LatLon ll2 = ProjectionRegistry.getProjection().eastNorth2latlon(center);110 ILatLon ll1 = ProjectionRegistry.getProjection().eastNorth2latlon(p1); 111 ILatLon ll2 = ProjectionRegistry.getProjection().eastNorth2latlon(center); 112 112 113 113 double radiusInMeters = ll1.greatCircleDistance(ll2);
Note:
See TracChangeset
for help on using the changeset viewer.