Changeset 12986 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-10-11T20:42:06+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java
r12187 r12986 139 139 return p; 140 140 } 141 142 /** 143 * Returns the layer value of primitive (null for layer 0). 144 * @param w OSM primitive 145 * @return the value of "layer" key, or null if absent or set to 0 (default value) 146 * @since 12986 147 */ 148 public static String getLayer(OsmPrimitive w) { 149 String layer1 = w.get("layer"); 150 if ("0".equals(layer1)) { 151 layer1 = null; // 0 is default value for layer. 152 } 153 return layer1; 154 } 141 155 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
r12958 r12986 13 13 import org.openstreetmap.josm.data.coor.EastNorth; 14 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 import org.openstreetmap.josm.data.osm.OsmUtils; 15 16 import org.openstreetmap.josm.data.osm.Relation; 16 17 import org.openstreetmap.josm.data.osm.Way; … … 71 72 if (w1 == w2) 72 73 return false; 73 if (!Objects.equals( getLayer(w1),getLayer(w2))) {74 if (!Objects.equals(OsmUtils.getLayer(w1), OsmUtils.getLayer(w2))) { 74 75 return true; 75 76 } … … 164 165 @Override 165 166 boolean ignoreWaySegmentCombination(Way w1, Way w2) { 166 return !Objects.equals( getLayer(w1),getLayer(w2));167 return !Objects.equals(OsmUtils.getLayer(w1), OsmUtils.getLayer(w2)); 167 168 } 168 169 … … 232 233 cellSegments.clear(); 233 234 seenWays.clear(); 234 }235 236 static String getLayer(OsmPrimitive w) {237 String layer1 = w.get("layer");238 if ("0".equals(layer1)) {239 layer1 = null; // 0 is default value for layer.240 }241 return layer1;242 235 } 243 236 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r12809 r12986 8 8 import java.util.List; 9 9 import java.util.NoSuchElementException; 10 import java.util.Objects; 10 11 import java.util.Set; 11 12 import java.util.function.IntFunction; … … 16 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 18 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 19 import org.openstreetmap.josm.data.osm.OsmUtils; 18 20 import org.openstreetmap.josm.data.osm.Relation; 19 21 import org.openstreetmap.josm.data.osm.RelationMember; … … 258 260 259 261 private final class CrossingFinder extends AbstractFinder { 262 263 private final String layer; 264 260 265 private CrossingFinder(Environment e) { 261 266 super(e); 262 267 CheckParameterUtil.ensureThat(e.osm instanceof Way, "Only ways are supported"); 268 layer = OsmUtils.getLayer(e.osm); 263 269 } 264 270 265 271 @Override 266 272 public void visit(Way w) { 267 if (e.child == null && left.matches(new Environment(w).withParent(e.osm)) 273 if (e.child == null && Objects.equals(layer, OsmUtils.getLayer(w)) 274 && left.matches(new Environment(w).withParent(e.osm)) 268 275 && e.osm instanceof Way && Geometry.PolygonIntersection.CROSSING.equals( 269 276 Geometry.polygonIntersection(w.getNodes(), ((Way) e.osm).getNodes()))) {
Note:
See TracChangeset
for help on using the changeset viewer.