Thanks, I'll checkout recode. I have no idea what value I am getting for
wms_scale_denominator... I even made the first test in the script scale >=
10000000 and it still returned true.
From: Jody Garnett [mailto:[email protected]]
Sent: Saturday, February 08, 2014 11:52 PM
To: Keane, Tim
Subject: Re: [Geoserver-devel] Custom function in SLD
The recode function can be used for switch statement like logic. So no need to
write a custom function.
I wonder what value you are getting for wms_scale_denominator ?
Jody Garnett
On Sun, Feb 9, 2014 at 6:22 AM, Keane, Tim
<[email protected]<mailto:[email protected]>> wrote:
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]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
------------------------------------------------------------------------------
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