The CSS community
module<http://docs.geoserver.org/stable/en/user/community/css/index.html>is
also good for this kind of thing. You could accomplish what you're
talking about with a stylesheet like:
* { /* common properties */ }
[DYNAMIC <= 1000] { fill: #fffdd7 }
[DYNAMIC > 1000] [DYNAMIC <= 2000] { fill: #fce8a9 }
[DYNAMIC > 2000] [DYNAMIC <= 3000] { fill: #fbe06d }
[DYNAMIC > 3000] [DYNAMIC <= 4000] { fill: #fac926 }
[DYNAMIC > 4000] { fill: #f6a62d }
(Assuming DYNAMIC is the name of your dynamic property.)
You could also accomplish it with OGC Filter expressions in the SLD:
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Function name="if_then_else">
<ogc:Function name="lessEqualThan">
<ogc:PropertyName>DYNAMIC</ogc:PropertyName>
<ogc:Literal>1000</ogc:Literal>
</ogc:Function>
<ogc:Literal>#fffdd7</ogc:Literal>
<ogc:Literal>#f6a62d</ogc:Literal>
</ogc:Function>
</CssParameter>
</Fill>
</PolygonSymbolizer>
But that becomes cumbersome quickly as the number of choices increases.
--
David Winslow
OpenGeo - http://opengeo.org/
On Thu, Aug 19, 2010 at 11:08 AM, Andrea Aime <[email protected]> wrote:
> Hajo Kliemeck ha scritto:
> > Hi Andrea,
> >
> > i just want to associate numbers(sales volume) that are stored in a
> > database to polygons (in that case the polygons are the features which
> > are requested). afterwards i want to fill these polygons with the help
> > of a color table and sld rules. e.g.
> >
> > dynamic-number-property lower/equal 1000 -> fill color = #fffdd7
> > dynamic-number-property lower/equal 2000 -> fill color = #fce8a9
> > dynamic-number-property lower/equal 3000 -> fill color = #fbe06d
> > dynamic-number-property lower/equal 4000 -> fill color = #fac926
> > dynamic-number-property higher 4000 -> fill color = #f6a62d
> > ...
> >
> > the problem is, that the properties are static. and THATS my problem!
> > i think that should be clear enough, right?
>
> Nope. I don't see why you cannot just use various rules in SLD.
> I guess it's because the logic to assign the dynamic-number-property
> is complex.
> In that case your best bet is probably to code up a filter function,
> it takes the full feature as a parameter can be used directly
> as the source of the color.
> We don't have a programming guide for that, but have a look
> at this one and try to replicate:
>
> http://svn.osgeo.org/geotools/trunk/modules/library/main/src/main/java/org/geotools/filter/function/FilterFunction_numberFormat.java
> And then you have to also register it in a file with the same name
> and position as this one (but inside your jar):
>
> http://svn.osgeo.org/geotools/trunk/modules/library/main/src/main/resources/META-INF/services/org.opengis.filter.expression.Function
>
> I really hope soon we'll be able to offer people the ability to
> build such simple plugins with a scripting language leveraging
> Geoscript (http://geoscript.org)
>
> Cheers
> Andrea
>
> --
> Andrea Aime
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users