Following up with Ian suggestion,
the original filter contains several extra operations... I cannot try it of
course, don't have the data,
but what about something like this:
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>median_tot_hhd_inc_weekly</ogc:PropertyName>
<ogc:Literal>0.0</ogc:Literal>
</ogc:PropertyIsGreaterThan>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>median_mortgage_repay_monthly</ogc:PropertyName>
<ogc:Literal>0.0</ogc:Literal>
</ogc:PropertyIsGreaterThan>
<ogc:PropertyIsBetween>
<ogc:Div>
<ogc:PropertyName>median_mortgage_repay_monthly</ogc:PropertyName>
<ogc:Mul>
<ogc:PropertyName>median_tot_hhd_inc_weekly</ogc:PropertyName>
<ogc:Literal>4.33333333</ogc:Literal>
</ogc:Mul>
</ogc:Div>
<ogc:LowerBoundary>
<ogc:Literal>0.3</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>0.8</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:And>
</ogc:Filter>
Observations:
- The filters are in a different namespace than the SLD elements, given
your prefix declaration in the top element, they should all be prefixed by
"ogc:"
- A single and can have as many predicates as you like, they are going
to be evaluated in turn with short circuit evaluation
- No need to multiply by 100, just use 0.3 and 0.8 instead of 30 and 80
- PropertyIsBetween seems indeed more concise and clear, avoids
repeating the subject of the comparison twice
As said, could test it, but hope it's useful nevertheless
Cheers
Andrea
On Thu, Mar 26, 2020 at 6:06 PM Ian Turton <[email protected]> wrote:
> Maybe you could use a Between filter?
>
> Ian
>
>
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
--
Regards, Andrea Aime == 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
------------------------------------------------------- *Con riferimento
alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 -
Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto, gli eventuali
allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i
destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per
errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le
sarei comunque grato se potesse darmene notizia. This email is intended
only for the person or entity to which it is addressed and may contain
information that is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European Regulation 2016/679
“GDPR” - copying, dissemination or use of this e-mail or the information
herein by anyone other than the intended recipient is prohibited. If you
have received this email by mistake, please notify us immediately by
telephone or e-mail.*
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users