Hello,
I posted the relevant part of my SLD at the bottom. I wonder if I can use
geoserver variable substitution to pass the threshold values (like -9999, 0,
1.5) in my WMS url.
The examples I saw with variable substitution always refer to a constant
literal (like size):
<ogc:Function name="env">
<ogc:Literal>size</ogc:Literal>
</ogc:Function>
But in this case I think I actually have to change that literal? Any ideas?
Thanks!
<CssParameter name="stroke">
<ogc:Function name="Interpolate">
<ogc:PropertyName>VALUE</ogc:PropertyName>
<ogc:Literal>-9999</ogc:Literal>
<ogc:Literal>#000000</ogc:Literal>
<ogc:Literal>0</ogc:Literal>
<ogc:Literal>#000000</ogc:Literal>
<ogc:Literal>0</ogc:Literal>
<ogc:Literal>#A51C1C</ogc:Literal>
<ogc:Literal>1.5</ogc:Literal>
<ogc:Literal>#FF9A9A</ogc:Literal>
<ogc:Literal>1.5</ogc:Literal>
<ogc:Literal>#00FF00</ogc:Literal>
<ogc:Literal>color</ogc:Literal>
</ogc:Function>
</CssParameter>
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-Use-variable-substitution-for-transform-function-like-interpolate-tp5259323.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Hi,
if I understand the question correctly, you can pass a second parameter
to env, which will provide a default value, so that you are not forced
to pass the env variable in all GetMap calls:
<ogc:Function name=“env”>
ogc:Literalsize</ogc:Literal>
ogc:Literal10</ogc:Literal>
</ogc:Function>
Also see the documentation:
http://docs.geoserver.org/2.8.x/en/user/styling/sld-extensions/substitution.html
Cheers
Andrea
···
On Sat, Apr 2, 2016 at 7:26 PM, hanshupe <paul.schneeweiss@anonymised.com> wrote:
Hello,
I posted the relevant part of my SLD at the bottom. I wonder if I can use
geoserver variable substitution to pass the threshold values (like -9999, 0,
1.5) in my WMS url.
The examples I saw with variable substitution always refer to a constant
literal (like size):
<ogc:Function name=“env”>
ogc:Literalsize</ogc:Literal>
</ogc:Function>
But in this case I think I actually have to change that literal? Any ideas?
Thanks!
VALUE
-9999
#000000
0
#000000
0
#A51C1C
1.5
#FF9A9A
1.5
#00FF00
color
–
View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-Use-variable-substitution-for-transform-function-like-interpolate-tp5259323.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
–
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.
Hello,
Sorry if I was unclear, my problem is that I want to apply variable
substitution for this sld part:
...
<ogc:Literal>-9999</ogc:Literal>
<ogc:Literal>#000000</ogc:Literal>
<ogc:Literal>0</ogc:Literal>
<ogc:Literal>#000000</ogc:Literal>
<ogc:Literal>0</ogc:Literal>
...
In the geoserver examples there is a fixed literal (like size), which value
is set by variable substitution. But in my sld code with the transformation
function I don't have this fixed literal, but input/output pairs
(value/color) and I want to specify the threshold values (e.g. -9999, 0,...)
by variable substitution.
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-Use-variable-substitution-for-transform-function-like-interpolate-tp5259323p5259328.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Ok it's solved, I didn't know that I can just define my own parameter name
and put it inside the literal. Thanks!
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-Use-variable-substitution-for-transform-function-like-interpolate-tp5259323p5259329.html
Sent from the GeoServer - User mailing list archive at Nabble.com.