Hi List,
I have a property that contains orientation for a label, unfortunately it’s the wrong way (wouldn’t it be nice if everyone just used the same convention for orienting and anchoring?). So where my data has “90” it should be pointing upward, but GeoServer points this downwards.
Filter Functions should let me fix I think this but I’m coming unstuck - I’m struggling to find examples to work from.
Psuedocode:
if PROPERTY > 0
basically I want to put a minus (-) in front of positives and a plus (+) in front of negatives. How do I do this in an SLD?
Thanks,
Jonathan
This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.
On Tue, Jun 25, 2013 at 5:23 PM, Jonathan Moules <
jonathanmoules@anonymised.com> wrote:
Hi List,
I have a property that contains orientation for a label, unfortunately
it's the wrong way (wouldn't it be nice if everyone just used the same
convention for orienting and anchoring?). So where my data has "90" it
should be pointing upward, but GeoServer points this downwards.
Filter Functions should let me fix I think this but I'm coming unstuck -
I'm struggling to find examples to work from.
Psuedocode:
if PROPERTY > 0
- PROPERTY
else
+ PROPERTY
endif
basically I want to put a minus (-) in front of positives and a plus (+)
in front of negatives. How do I do this in an SLD?
Not sure it's going to move the arrow exactly where you'd like it, but try
this:
<ogc:Mul>
<ogc:Literal>-1</ogc:Literal>
<ogc:PropertyName>yourProperty</ogc:PropertyName>
</ogc:Mul>
Cheers
Andrea
--
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
Oooh, I’ll have to remember that trick (multiply by -1 to invert). Why yes I barely scraped through maths at school
.
That should do exactly what I want.
Thanks muchly!
Jonathan
···
Hi List,
I have a property that contains orientation for a label, unfortunately it’s the wrong way (wouldn’t it be nice if everyone just used the same convention for orienting and anchoring?). So where my data has “90” it should be pointing upward, but GeoServer points this downwards.
Filter Functions should let me fix I think this but I’m coming unstuck - I’m struggling to find examples to work from.
Psuedocode:
if PROPERTY > 0
basically I want to put a minus (-) in front of positives and a plus (+) in front of negatives. How do I do this in an SLD?
Not sure it’s going to move the arrow exactly where you’d like it, but try this:
ogc:Mul
ogc:Literal-1</ogc:Literal>
ogc:PropertyNameyourProperty</ogc:PropertyName>
</ogc:Mul>
Cheers
Andrea
–
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it