Changeset 13598 in osm for applications/editors/josm/plugins/validator/src/org
- Timestamp:
- 2009-02-08T16:06:16+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnclosedWays.java
r13497 r13598 8 8 import java.util.List; 9 9 10 import org.openstreetmap.josm.data. coor.LatLon;10 import org.openstreetmap.josm.data.osm.Node; 11 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 12 import org.openstreetmap.josm.data.osm.OsmUtils; … … 103 103 set(true, 1130, marktr("area")); 104 104 105 if (type != null) { 106 LatLon s = w.nodes.get(0).coor; 107 LatLon e = w.nodes.get(w.nodes.size() - 1).coor; 108 /* take unclosed ways with end-to-end-distance below 10 km */ 109 if (s != e && (force || s.greatCircleDistance(e) < 10000)) { 105 if (type != null && !w.isClosed()) 106 { 107 Node f = w.nodes.get(0); 108 Node l = w.nodes.get(w.nodes.size() - 1); 109 if(force || f.coor.greatCircleDistance(l.coor) < 10000) 110 { 110 111 List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>(); 111 112 List<OsmPrimitive> highlight = new ArrayList<OsmPrimitive>(); 112 113 primitives.add(w); 113 // The important parts of an unclosed way are the first and 114 // The important parts of an unclosed way are the first and 114 115 // the last node which should be connected, therefore we highlight them 115 highlight.add( w.nodes.get(0));116 highlight.add( w.nodes.get(w.nodes.size() - 1));116 highlight.add(f); 117 highlight.add(l); 117 118 errors.add(new TestError(this, Severity.WARNING, tr("Unclosed way"), type, etype, mode, primitives, 118 119 highlight)); -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnconnectedWays.java
r13497 r13598 83 83 for(MyWaySegment s : ways) 84 84 { 85 if(!s.highway && s.nearby(en, mindist) )85 if(!s.highway && s.nearby(en, mindist) && !s.isArea()) 86 86 map.put(en, s.w); 87 87 } … … 91 91 for(MyWaySegment s : ways) 92 92 { 93 if(s.nearby(en, mindist) )93 if(s.nearby(en, mindist) && !s.isArea()) 94 94 map.put(en, s.w); 95 95 } … … 166 166 return !w.nodes.contains(n) 167 167 && line.ptSegDist(n.eastNorth.east(), n.eastNorth.north()) < dist; 168 } 169 170 public boolean isArea() { 171 return w.get("landuse") != null 172 || w.get("leisure") != null 173 || w.get("building") != null; 168 174 } 169 175 }
Note:
See TracChangeset
for help on using the changeset viewer.