Changeset 8253 in josm
- Timestamp:
- 2015-04-23T19:45:32+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r8199 r8253 28 28 import org.openstreetmap.josm.data.osm.Node; 29 29 import org.openstreetmap.josm.data.osm.OsmPrimitive; 30 import org.openstreetmap.josm.data.osm.Way; 30 31 import org.openstreetmap.josm.gui.mappaint.Cascade; 31 32 import org.openstreetmap.josm.gui.mappaint.Environment; … … 33 34 import org.openstreetmap.josm.io.XmlWriter; 34 35 import org.openstreetmap.josm.tools.ColorHelper; 36 import org.openstreetmap.josm.tools.Geometry; 35 37 import org.openstreetmap.josm.tools.Predicates; 36 38 import org.openstreetmap.josm.tools.RightAndLefthandTraffic; … … 499 501 500 502 /** 503 * Returns the area of a closed way in square meters or {@code null}. 504 * @param env the environment 505 * @return the area of a closed way in square meters or {@code null} 506 * @see Geometry#closedWayArea(Way) 507 */ 508 public static Float areasize(final Environment env) { 509 if (env.osm instanceof Way && ((Way) env.osm).isClosed()) { 510 return (float) Geometry.closedWayArea((Way) env.osm); 511 } else { 512 return null; 513 } 514 } 515 516 /** 517 * Returns the length of the way in metres or {@code null}. 518 * @param env the environment 519 * @return the length of the way in metres or {@code null}. 520 * @see Way#getLength() 521 */ 522 public static Float waylength(final Environment env) { 523 if (env.osm instanceof Way) { 524 return (float) ((Way) env.osm).getLength(); 525 } else { 526 return null; 527 } 528 } 529 530 /** 501 531 * Function associated to the logical "!" operator. 502 532 * @param b boolean value
Note:
See TracChangeset
for help on using the changeset viewer.