Hi Devs,
having a polygon dataset, I want to show small polygons (<1m2) different from the rest of the polygons
I thought to use the 'area' function which according to this:
http://docs.geoserver.org/stable/en/user/filter/function_reference.html
would give:
"The area of the specified geometry. Works in a Cartesian plane, the result will be in the same unit of measure as the geometry coordinates (which also means the results won’t make any sense for geographic data)"
But what I observe here is that it returns the size in pixels, while data is in meters.
Because zooming in I saw the style of some bigger polygons change (while off course the geometry area itself stays the same).
Also showing the area in a label shows that on zooming in the area is changing on every zoomlevel...
QUESTION:
- is this supposed behaviour or is this a bug?
- IS it possible to use the geometry area in filters/labels
Note: Tried both Area and area
Regards,
Richard Duivenvoorde
PS: example rule below
<Rule>
<Name>poly</Name>
<Title>poly</Title>
<ogc:Filter>
<ogc:PropertyIsGreaterThan>
<ogc:Function name="area">
<ogc:PropertyName>GEOM</ogc:PropertyName>
</ogc:Function>
<ogc:Literal>1.0</ogc:Literal>
</ogc:PropertyIsGreaterThan>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#104DAF</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>0.4</ogc:Literal>
</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#104DAF</CssParameter>
<CssParameter name="stroke-width">1</CssParameter>
</Stroke>
</PolygonSymbolizer>
<TextSymbolizer>
<Label>
<ogc:Function name="Area">
<ogc:PropertyName>GEOM</ogc:PropertyName>
</ogc:Function>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">14</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
<CssParameter name="font-weight">bold</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0.5</AnchorPointX>
<AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
</PointPlacement>
</LabelPlacement>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
</TextSymbolizer>
</Rule>
<Rule>
<Name>point</Name>
<Title>point</Title>
<ogc:Filter>
<ogc:PropertyIsLessThanOrEqualTo>
<ogc:Function name="area">
<ogc:PropertyName>GEOM</ogc:PropertyName>
</ogc:Function>
<ogc:Literal>1</ogc:Literal>
</ogc:PropertyIsLessThanOrEqualTo>
</ogc:Filter>
<PointSymbolizer>
<Graphic>
<ExternalGraphic>
<OnlineResource xlink:type="simple" xlink:href="point.svg" />
<Format>image/svg+xml</Format>
</ExternalGraphic>
</Graphic>
</PointSymbolizer>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#ff0000</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>0.4</ogc:Literal>
</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#ff0000</CssParameter>
<CssParameter name="stroke-width">1</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>