I am attempting to determine the size of a point symbol based on scale using a 
custom function.  However, the first test of scale (if scale >= 500000:) always 
evaluates to true.  I have chosen the scales for the script based on the fact 
that my base layer in an OL3 app is an OpenLayers.Layer.ArcGISCache with the 
following config http://maps.nyc.gov/gis/data/tiles/conf.xml

FUNCTION (iconSize.py):

def run(value, args):
       scale = args[0]
       if scale >= 500000:
             return 20
       elif scale >= 350000:
             return 22
       elif scale >= 256000:
             return 24
       elif scale >= 128000:
             return 26
       elif scale >= 64000:
             return 28
       elif scale >= 32000:
             return 30
       elif scale >= 16000:
             return 32
       elif scale >= 8000:
             return 34
       elif scale >= 4000:
             return 36
       elif scale >= 2000:
             return 38
       else:
             return 40


SLD:

<?xml version="1.0" encoding="UTF-8"?>
<sld:UserStyle xmlns="http://www.opengis.net/sld";
       xmlns:sld="http://www.opengis.net/sld";
       xmlns:ogc="http://www.opengis.net/ogc";
       xmlns:gml="http://www.opengis.net/gml";>
       <sld:Name>Default Styler</sld:Name>
       <sld:FeatureTypeStyle>
             <sld:Name>name</sld:Name>
             <sld:Rule>
                    <sld:PointSymbolizer>
                           <sld:Graphic>
                                 <sld:ExternalGraphic>
                                        <sld:OnlineResource 
xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:type="simple"
                                               
xlink:href="http://localhost:82/geoserver/styles/mapIcons/Recovery.svg"/>
                                        <sld:Format>image/svg+xml</sld:Format>
                                 </sld:ExternalGraphic>
                                 <sld:Size>
                                        <ogc:Function name="iconSize">
                                               <ogc:Function name="env">
                                                      
<ogc:Literal>wms_scale_denominator</ogc:Literal>
                                               </ogc:Function>
                                        </ogc:Function>
                                 </sld:Size>
                           </sld:Graphic>
                    </sld:PointSymbolizer>
             </sld:Rule>
       </sld:FeatureTypeStyle>
</sld:UserStyle>


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to