Andrea,
Thanks again. Your suggestion looks fine and I can test this on two data
elements that are compatible and I will assume that it will work. But my
particular situation is that I am dividing a monthly statistic with a weekly
statistic. So in order to make it a monthly percentage I need to multiply the
weekly statistic by 4.33333 (152/12). I will adapt your SLD to do that and test
it. If I can’t get this to work and given this is a simple filter I may need to
try a CQL filter instead.
So I will test this filter later today.
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>median_MONTHLY_mortgage_value</ogc:PropertyName>
<ogc:Literal>0.0</ogc:Literal>
</ogc:PropertyIsGreaterThan>
<ogc:PropertyIsBetween>
<ogc:Div>
<ogc:PropertyName>median_MONTHLY_mortgage_value</ogc:PropertyName>
<ogc:Mul>
<ogc:PropertyName> median_WEEKLY_income_value </ogc:PropertyName>
<ogc:Literal>4.333333</ogc:Literal>
</ogc:Mul>
</ogc:Div>
<ogc:LowerBoundary>
<ogc:Literal>0.45</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>0.65</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:And>
</ogc:Filter>
Thanks again.
Cheers, Brad….
From: Andrea Aime <[email protected]>
Sent: 29 March 2020 03:45
To: Brad Spencer <[email protected]>
Cc: Brad Hards <[email protected]>; GeoServer Mailing List List
<[email protected]>
Subject: Re: [Geoserver-users] SLD on Geoserver
Hi Brad,
I don't have your dataset, so could not use a 1-1 reproduction, but adapted
your original style, plus my suggestion,
to the topp:states sample dataset (included in the default installation of
GeoServer), calculating a percentage of
employed people, and painting red only the states having between 45% and 65%
employed.
The style is:
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>undefined</Name>
<UserStyle>
<Title>braddles tester7</Title>
<FeatureTypeStyle>
<Rule>
<Name>Employed between 45% and 65%</Name>
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>PERSONS</ogc:PropertyName>
<ogc:Literal>0.0</ogc:Literal>
</ogc:PropertyIsGreaterThan>
<ogc:PropertyIsBetween>
<ogc:Div>
<ogc:PropertyName>EMPLOYED</ogc:PropertyName>
<ogc:PropertyName>PERSONS</ogc:PropertyName>
</ogc:Div>
<ogc:LowerBoundary>
<ogc:Literal>0.45</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>0.65</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:And>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#FF0000</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#000000</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
and the resulting map is:
Appears to be working here. I cannot imagine why something similar would not
work in another dataset... maybe if you can share
a sample of the data, some of us here can load it up and give it a spin
Cheers
Andrea
On Sat, Mar 28, 2020 at 2:01 PM Brad Spencer <[email protected]
<mailto:[email protected]> > wrote:
Brad,
I can’t see anything wrong with the data. I can inspect polygons that should be
rendered but which are not.
I am wondering is there is any other way in Geoserver to show percentage ranges?
Cheers, Brad….
From: Brad Hards <[email protected] <mailto:[email protected]> >
Sent: 28 March 2020 09:24
To: 'Brad Spencer' <[email protected] <mailto:[email protected]> >;
[email protected]
<mailto:[email protected]>
Subject: RE: [Geoserver-users] SLD on Geoserver
I think its more likely that there is something in the source data that isn’t
being accounted for.
I’d look there next. What are the mean, range, stddev of the data in the
database? Are there nulls?
Brad
From: Brad Spencer <[email protected] <mailto:[email protected]> >
Sent: Saturday, 28 March 2020 8:11 AM
To: 'Brad Hards' <[email protected] <mailto:[email protected]> >;
[email protected]
<mailto:[email protected]>
Subject: RE: [Geoserver-users] SLD on Geoserver
Brad,
When I try to find the polygons below 30% as you suggested I do not get the
reverse of polygons above 30%.
This is really weird as it would appear to me that the
<PropertyIsLessThanOrEqualTo> and for that matter the <PropertyIsLessThan> are
not working correctly at least not on my version of Geoserver, or the Ands are
not configured correctly.
I get the same results testing via the geoserver app where I loaded a style
with the same sld.
Cheers, Brad…
From: Brad Hards <[email protected] <mailto:[email protected]> >
Sent: 27 March 2020 09:13
To: 'Brad Spencer' <[email protected] <mailto:[email protected]> >;
[email protected]
<mailto:[email protected]>
Subject: RE: [Geoserver-users] SLD on Geoserver
It sounds (to me) like your SLD is not matching your data – we can’t see the
data of course, but if you change your analysis to be all polygons below 30%
(just keep the first check, and use PropertyIsLessThanOrEqualTo), does it look
right? Do you get anything?
Brad
_______________________________________________
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]
<mailto:[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