On 02/01/13 16:18, Ákos Maróy wrote:
> 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.
>
a consideration to my own remark: this approach actually wouldn't work,
as not all literals in such an expression are lengths expressed in a
unit of measurement, as some numerics are just scalar values. (say, a
multiplier can be just a scalar value (multiply by 4), which should not
be scaled, or a length value of a specific unit, which should be scaled

this is all not simple, but how I see it that the real solution is
really to introduce a notation where one can specify the unit of
measurement with the constant itself (say, 1m, 2ft, 3km, 1nm, 3mm, 4px).
this of course still would not specify the reference, that is, if it's a
target-device size, or a real-world size.

of course as a work-around, one can basically generate a bunch of SLDs
by a script, and load them all into geo-server.

or, one can write SLDs that reference variables and complex
calculations. for example, the following:

<sld:CssParameter name="stroke-width">
    <ogc:Mul>
        <ogc:Function name="env">
            <ogc:Literal>wms_scale_denominator</ogc:Literal>
            <ogc:Literal>500000</ogc:Literal>
        </ogc:Function>
        <ogc:Literal>0.0005</ogc:Literal>
    </ogc:Mul>
</sld:CssParameter>


basically describes a 0.5mm stroke width, with a default scale of
1:500,000. but this makes the SLD quite complex, and actually points to
the direction that one should generate SLDs using scripts. moreover, the
above expressions don't work everywhere, for example, they don't work
with VendorOptions.


Akos

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to