From: Ákos M. <ak...@ma...> - 2013-01-02 15:18:32
|
Andrea, Another issue came up with uoms, and this is also not specific to device-size uoms, but with any uom already defined earlier. This is the case of expressions, or rather, when using constants in expressions. Consider for example the following: <sld:PolygonSymbolizer uom="http://www.opengeospatial.org/se/units/metre"> <sld:Geometry> <ogc:Function name="buffer"> <ogc:PropertyName>way</ogc:PropertyName> <ogc:Literal>300</ogc:Literal> </ogc:Function> </sld:Geometry> <sld:Fill> <sld:CssParameter name="fill">#FF0000</sld:CssParameter> <sld:CssParameter name="fill-opacity">0.4</sld:CssParameter> </sld:Fill> </sld:PolygonSymbolizer> one would assume that the above would create a buffer of the polygon at hand, with a 300m (real-world) distance from the original polygon. but, what the current code does is that the buffer is 300 pixels from the polygon. now, there is a simple omission in the code, in UomRescaleStyleVisitor.visit(PolygonSymbolizer), the polygon's geometry is not rescaled.. but even if one adds the following line: rescale(copy.getGeometry(), mapScale, dpi, copy.getUnitOfMeasure()); the results is not what one would expect. the result of the above line is basically equivalent to: <sld:Geometry> <ogc:Mul> <ogc:Function name="buffer"> <ogc:PropertyName>way</ogc:PropertyName> <ogc:Literal>300</ogc:Literal> </ogc:Function> <ogc:Literal>scale_factor</ogc:Literal> </ogc:Mul> </sld:Geometry> which doesn't bring the desired result. I wonder if this issue has been considered, and what the general acceptance would be if one would implement a fix so that all literal values inside such expressions are scaled, according to the uom scaling factory. best regards, Akos |