Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 8252)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 8253)
@@ -28,4 +28,5 @@
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.mappaint.Cascade;
 import org.openstreetmap.josm.gui.mappaint.Environment;
@@ -33,4 +34,5 @@
 import org.openstreetmap.josm.io.XmlWriter;
 import org.openstreetmap.josm.tools.ColorHelper;
+import org.openstreetmap.josm.tools.Geometry;
 import org.openstreetmap.josm.tools.Predicates;
 import org.openstreetmap.josm.tools.RightAndLefthandTraffic;
@@ -499,4 +501,32 @@
 
         /**
+         * Returns the area of a closed way in square meters or {@code null}.
+         * @param env the environment
+         * @return the area of a closed way in square meters or {@code null}
+         * @see Geometry#closedWayArea(Way)
+         */
+        public static Float areasize(final Environment env) {
+            if (env.osm instanceof Way && ((Way) env.osm).isClosed()) {
+                return (float) Geometry.closedWayArea((Way) env.osm);
+            } else {
+                return null;
+            }
+        }
+
+        /**
+         * Returns the length of the way in metres or {@code null}.
+         * @param env the environment
+         * @return the length of the way in metres or {@code null}.
+         * @see Way#getLength()
+         */
+        public static Float waylength(final Environment env) {
+            if (env.osm instanceof Way) {
+                return (float) ((Way) env.osm).getLength();
+            } else {
+                return null;
+            }
+        }
+
+        /**
          * Function associated to the logical "!" operator.
          * @param b boolean value
