Changeset 9952 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2016-03-07T23:29:30+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r9929 r9952 531 531 532 532 /** 533 * Returns the area of a closed way in square meters or {@code null}.534 * @param env the environment 535 * @return the area of a closed way in square meters or {@code null}536 * @see Geometry#c losedWayArea(Way)533 * Returns the area of a closed way or multipolygon in square meters or {@code null}. 534 * @param env the environment 535 * @return the area of a closed way or multipolygon in square meters or {@code null} 536 * @see Geometry#computeArea(OsmPrimitive) 537 537 */ 538 538 public static Float areasize(final Environment env) { 539 if (env.osm instanceof Way && ((Way) env.osm).isClosed()) { 540 return (float) Geometry.closedWayArea((Way) env.osm); 541 } else { 542 return null; 543 } 539 final Double area = Geometry.computeArea(env.osm); 540 return area == null ? null : area.floatValue(); 544 541 } 545 542
Note:
See TracChangeset
for help on using the changeset viewer.