http://docs.geoserver.org/stable/en/user/community/css/index.html

I suggest that you consider the CSS community extension (disclaimer: I am
the author.)  A major design goal for this module is to expose all SLD
functionality, but it uses a much more compact notation making complex
styles easier to read and write.  With this, you could write the style you
described like so:

[@scale > 100000] [modulo(elevation, 500) == 0] { stroke: black; }

[@scale < 100000] [modulo(elevation, 50) == 0] { stroke: black; }

This will generate an SLD (literally; the CSS files are converted to SLD
files on disk) which uses Min/MaxScaleDenominator elements to select which
rendering to use.  You can also combine selectors with a comma to share the
same styling properties for multiple selectors.

[@scale > 100000] [modulo(elevation, 500) == 0],
[@scale < 100000] [modulo(elevation, 50) == 0] { stroke: black; }

Note how you only specify the stroke once, ensuring that any dash, opacity,
etc. properties will be consistent for the different cases.

--
David Winslow
OpenGeo - http://opengeo.org/


On Thu, Jan 3, 2013 at 8:38 AM, Ákos Maróy <[email protected]> wrote:

>  On 03/01/13 14:30, lysgaard wrote:
>
> I'm working on the Open Aviation Map project.
> We're using Geoserver for styling via SDL.
> There are several places one wants the map to scale it's detail level based
> on the zoom level.
>
> Take elevation contour lines. When zoomed in it makes sense to show
> contour lines for maybe every 50th metres, but when zoomed out,
> maybe just for every 300-500 metres.
> I understand that it would be possible to hard code all this using
> max scale denominator but this would be extremely tedious and wery
> prone to error. Does there exist any smarter way. I guess I'm looking for
> some way to do basic calculations in the style based on the scale
> denominator
> and by that calculate the values i want height curves for. Maybe SLD is the
> wrong
> way to do this altogether?
>
>
>
>  actually, you have the scale denominator as an environment variable in
> SLD, see:
> http://docs.geoserver.org/stable/en/user/styling/sld-extensions/substitution.html
>
> you can use it for example in the following way:
>
>         <ogc:Function name="env">
>             <ogc:Literal>wms_scale_denominator</ogc:Literal>
>             <ogc:Literal>500000</ogc:Literal>
>         </ogc:Function>
>
> where the second value is a fallback / default value
>
>
>
>
> ------------------------------------------------------------------------------
> 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
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
------------------------------------------------------------------------------
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
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to