Changeset 7828 in josm
- Timestamp:
- 2014-12-19T01:52:29+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DistributeAction.java
r7005 r7828 155 155 for (Iterator<Node> it = col.iterator(); it.hasNext();) { 156 156 Node n = it.next(); 157 if ( n.getCoor() == null) {157 if (!n.isLatLonKnown()) { 158 158 it.remove(); 159 159 result.add(n); -
trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java
r7146 r7828 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.actions; 3 4 import java.awt.event.ActionEvent; 5 import java.util.ArrayList; 6 import java.util.Collection; 7 import java.util.TreeMap; 3 8 4 9 import org.openstreetmap.josm.Main; … … 11 16 import org.openstreetmap.josm.data.osm.Way; 12 17 import org.openstreetmap.josm.tools.Geometry; 13 14 import java.awt.event.ActionEvent;15 import java.util.ArrayList;16 import java.util.Collection;17 import java.util.TreeMap;18 18 19 19 /** … … 72 72 73 73 /** 74 * Select a polygon or multipolgon by an internal point. 74 * Select a polygon or multipolygon by an internal point. 75 75 * 76 76 * @param internalPoint the internal point. -
trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
r7502 r7828 92 92 long startTime = System.currentTimeMillis(); 93 93 for (Node node : dataSet.getNodes()) { 94 if (!node.isIncomplete() && node.isVisible() && (node.getCoor() == null || node.getEastNorth() == null)) {94 if (!node.isIncomplete() && node.isVisible() && !node.isLatLonKnown()) { 95 95 printError("COMPLETE WITHOUT COORDINATES", "%s is not incomplete but has null coordinates", node); 96 96 } -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r6830 r7828 35 35 private double north = Double.NaN; 36 36 37 private boolean isLatLonKnown() { 37 /** 38 * Determines if this node has valid coordinates. 39 * @return {@code true} if this node has valid coordinates 40 * @since 7828 41 */ 42 public final boolean isLatLonKnown() { 38 43 return !Double.isNaN(lat) && !Double.isNaN(lon); 39 44 } … … 198 203 void setDataset(DataSet dataSet) { 199 204 super.setDataset(dataSet); 200 if (!isIncomplete() && isVisible() && (getCoor() == null || getEastNorth() == null))205 if (!isIncomplete() && isVisible() && !isLatLonKnown()) 201 206 throw new DataIntegrityProblemException("Complete node with null coordinates: " + toString()); 202 207 } -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r7796 r7828 601 601 if (Main.pref.getBoolean("debug.checkNullCoor", true)) { 602 602 for (Node n: nodes) { 603 if (n.isVisible() && !n.isIncomplete() && (n.getCoor() == null || n.getEastNorth() == null))603 if (n.isVisible() && !n.isIncomplete() && !n.isLatLonKnown()) 604 604 throw new DataIntegrityProblemException("Complete visible node with null coordinates: " + toString(), 605 605 "<html>" + tr("Complete node {0} with null coordinates in way {1}", -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r7792 r7828 314 314 /** 315 315 * Finds the intersection of two lines of infinite length. 316 * 316 * 317 317 * @param p1 first point on first line 318 318 * @param p2 second point on first line … … 328 328 CheckParameterUtil.ensureValidCoordinates(p3, "p3"); 329 329 CheckParameterUtil.ensureValidCoordinates(p4, "p4"); 330 330 331 331 if (!p1.isValid()) throw new IllegalArgumentException(); 332 332 … … 575 575 Node oldPoint = polygonNodes.get(polygonNodes.size() - 1); 576 576 577 if (!oldPoint.isLatLonKnown()) { 578 return false; 579 } 580 577 581 for (Node newPoint : polygonNodes) { 578 582 //skip duplicate points 579 583 if (newPoint.equals(oldPoint)) { 580 584 continue; 585 } 586 587 if (!newPoint.isLatLonKnown()) { 588 return false; 581 589 } 582 590 … … 733 741 result -= 2 * Math.PI; 734 742 } 735 743 736 744 return result; 737 745 }
Note:
See TracChangeset
for help on using the changeset viewer.