Hi David,
for some reason the scale matching code has had a tolerance in the match,
since... well I had
to go back to our SVN days to find out.... it seems it's there since 2003
:-D
The code looks as follows:
/** Tolerance used to compare doubles for equality */
private static final double TOLERANCE = 1e-6;
private boolean isWithInScale(Rule r) {
return ((r.getMinScaleDenominator() - TOLERANCE) <= scaleDenominator)
&& ((r.getMaxScaleDenominator() + TOLERANCE) > scaleDenominator);
}
So yeah, if the client is asking exactly for the a threshold scale
denominator, it's gonna match two subsequent rules.
I have no clue why it was done that way... although it seems I might have
been the original author of that, 17 years ago!
Looks like a bug to be, to be honest, but in all that time, who know, maybe
someone is depending on it for some
service to work as expected. TOLERANCE should probably be lowered to zero,
but with some system variable to raise
it back to its old value.
Want to open a bug report?
Cheers
Andrea
On Mon, Mar 23, 2020 at 2:47 PM David I <[email protected]> wrote:
> Hi there, we are preparing an upgrade of a server with various bits and are
> running into some new SLD problems. One being this, given a scale dependant
> sld of a point layer:
>
> <FeatureTypeStyle>
> <Rule>
> <Name>zoomniva_4</Name>
> <MinScaleDenominator>100000</MinScaleDenominator>
>
> <MaxScaleDenominator>200000</MaxScaleDenominator>
> <PointSymbolizer>
> <Graphic>
> <ExternalGraphic>
> <OnlineResource xlink:type="simple"
> xlink:href="svg/bad.svg"
> />
> <Format>image/svg+xml</Format>
> </ExternalGraphic>
> <Size>
> <ogc:Literal>20</ogc:Literal>
> </Size>
> </Graphic>
> </PointSymbolizer>
> </Rule>
>
> <Rule>
> <Name>zoomniva_5</Name>
> <MinScaleDenominator>50000</MinScaleDenominator>
> <MaxScaleDenominator>100000</MaxScaleDenominator>
> <PointSymbolizer>
> <Graphic>
> <ExternalGraphic>
> <OnlineResource xlink:type="simple"
> xlink:href="svg/bad.svg"
> />
> <Format>image/svg+xml</Format>
> </ExternalGraphic>
> <Size>
> <ogc:Literal>22</ogc:Literal>
> </Size>
> </Graphic>
> </PointSymbolizer>
> </Rule>
>
> since the Geoserver documentation at
> https://docs.geoserver.org/latest/en/user/styling/sld/reference/rules.html
> states that MaxScaleDenominator is exclusive, the scales should be able to
> overlap as above. " /Specifies the maximum scale denominator
> (exclusive)
> for the scale range in which this rule applies. If present, the rule
> applies
> at scales larger than the given scale./" - this leads me to believe the
> rule
> should start at 1:99999.
>
> Our trouble (2.16.2) is the same as with our old server (but now causing a
> problem thanks to a new map client) :
>
>
> wms?service=WMS&version=1.1.0&request=GetLegendGraphic&layer=badplatser&format=image/png&scale=100000
> returns the "zoomniva_4" as well as "zoomniva_5" rules, while scale=100001
> gives only "_4" and 99999 gives only "_5".
>
> I looked through the issues list for 2.16.2 and didn't find anything, and
> since the old server is at an older version of Geoserver I'm not sure that
> I'm not doing anything wrong. Logically it seems the likeliest but I can't
> seem to figure out what.
> Thanks for any enlightenment.
>
>
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html
>
>
> _______________________________________________
> 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