Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WMS 1.3.0 ScaleHint #488

Open
RGregat opened this issue Jun 26, 2018 · 1 comment
Open

WMS 1.3.0 ScaleHint #488

RGregat opened this issue Jun 26, 2018 · 1 comment

Comments

@RGregat
Copy link

RGregat commented Jun 26, 2018

Hi propably there is a little bug at this line
https://github.com/geopython/OWSLib/blob/master/owslib/map/wms130.py#L507

The way how the scale is currently read, is based on the WMS 1.1.1 specification. According to the official OGC WMS 1.3.0 specification http://portal.opengeospatial.org/files/?artifact_id=14416 on page 27 the scale is now represented by two XML-Tags <MinScaleDenominator> and <MaxScaleDenominator>.
Someone already added a testcase where the MaxScaleDenominator exists https://github.com/geopython/OWSLib/blob/master/tests/resources/wms_dov_getcapabilities_130.xml.

So this

sh = elem.find(nspath('ScaleHint', WMS_NAMESPACE))
        self.scaleHint = None
        if sh is not None:
            if 'min' in sh.attrib and 'max' in sh.attrib:
self.scaleHint = {'min': sh.attrib['min'], 'max': sh.attrib['max']}

might be changed to

minScale = elem.find(nspath('MinScaleDenominator', WMS_NAMESPACE))
maxScale = elem.find(nspath('MaxScaleDenominator', WMS_NAMESPACE))
self.scaleHint = None

min = minScale if minScale is not None else 1
max = maxScale if maxScale is not None else None

if max is not None:
   self.scaleHint = {'min': min, 'max': max}
@cehbrecht cehbrecht added this to the 0.17.0 milestone Jul 10, 2018
@cehbrecht cehbrecht modified the milestones: 0.17.0, 0.18.0 Sep 4, 2018
@pelord
Copy link

pelord commented Mar 13, 2019

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants