[Geoserver-devel] [JIRA] (GEOS-9556) maxScaleDenominator isn't exclusive

David Persson created an issue

GeoServer / BugGEOS-9556

maxScaleDenominator isn’t exclusive

Issue Type:

BugBug

Affects Versions:

2.16.2

Assignee:

Unassigned

Created:

30/Mar/20 6:17 PM

Priority:

MediumMedium

Reporter:

David Persson

https://docs.geoserver.org/latest/en/user/styling/sld/reference/rules.html states that scales can overlap between levels because the maxScaleDenominator is exclusive and the minScaleDenominator is inclusive.

That given
<Rule>
<Name>zoom_lvl_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>zoom_lvl_5</Name>
<MinScaleDenominator>50000</MinScaleDenominator>
<MaxScaleDenominator>100000</MaxScaleDenominator>
<PointSymbolizer>

wms?service=WMS&version=1.1.0&request=GetLegendGraphic&layer=layer&format=image/png&scale=100000 should return only the zoom_lvl_4 rule while it does return both the zoom_lvl_4 rule as well as the zoom_lvl_5 rule.

Andrea found the relevant bit of code in the SVN, from 2003 : )

/** Tolerance used to compare doubles for equality */
private static final double TOLERANCE = 1e-6;

private boolean isWithInScale(Rule r) {
    return ((r.getMinScaleDenominator() - TOLERANCE) &lt;= scaleDenominator)
            &amp;&amp; ((r.getMaxScaleDenominator() + TOLERANCE) &gt; scaleDenominator);
}

and as he mentions in the same email thread, who knows what sort of dependencies have grown on how the calculation is currently made, so if fixed then perhaps a method of using the existing way would be of use.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100122-sha1:8399ad5)

Atlassian logo