Legend:
- Unmodified
- Added
- Removed
-
trunk/data/validator/territories.mapcss
r15325 r15359 41 41 throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}"); 42 42 group: tr("Airport tagging"); 43 /* assertNoMatch: "way aeroway=aerodrome faa=OK12"; not properly working due to inside() */44 /* assertMatch: "way aeroway=aerodrome faa=ORD"; */43 assertNoMatch: "way aeroway=aerodrome faa=OK12"; 44 assertMatch: "way aeroway=aerodrome faa=ORD"; 45 45 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r15245 r15359 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Rectangle;7 6 import java.io.BufferedReader; 8 7 import java.io.IOException; … … 898 897 GeoProperty<Boolean> prop = index.getGeoProperty(); 899 898 if (prop instanceof DefaultGeoProperty) { 900 Rectangle bounds = ((DefaultGeoProperty) prop).getArea().getBounds(); 901 return new LatLon(bounds.getCenterY(), bounds.getCenterX()); 899 return ((DefaultGeoProperty) prop).getRandomLatLon(); 902 900 } 903 901 } -
trunk/src/org/openstreetmap/josm/tools/DefaultGeoProperty.java
r14484 r15359 2 2 package org.openstreetmap.josm.tools; 3 3 4 import java.awt.Rectangle; 4 5 import java.awt.geom.Area; 5 6 import java.awt.geom.Path2D; … … 17 18 18 19 private final Area area; 20 private LatLon random; 19 21 20 22 /** … … 68 70 return area; 69 71 } 72 73 /** 74 * Returns a random lat/lon in the area. 75 * @return a random lat/lon in the area 76 * @since 15359 77 */ 78 public final synchronized LatLon getRandomLatLon() { 79 if (random == null) { 80 Rectangle r = area.getBounds(); 81 double x, y; 82 do { 83 x = r.getX() + r.getWidth() * Math.random(); 84 y = r.getY() + r.getHeight() * Math.random(); 85 } while (!area.contains(x, y)); 86 87 random = new LatLon(y, x); 88 } 89 return random; 90 } 70 91 }
Note:
See TracChangeset
for help on using the changeset viewer.