OWSLib icon indicating copy to clipboard operation
OWSLib copied to clipboard

strict assertion styles

Open draro opened this issue 4 years ago • 3 comments

Hi, thanks for this amazing tool! I'm using the GetFeatureInfo to retrieve the info for a layer but as the different styles provide different information, I need to pass the styles args. In the wms11.py there is at line 167:

if styles:
            assert len(styles) == len(layers)
            request['styles'] = ','.join(styles)
        else:
            request['styles'] = ''

Having different lengths, the system return an error.

draro avatar Jan 01 '21 10:01 draro

For my needs I modified the wms111.py as follow:

if styles and len(styles) > 0:
            request['styles'] = styles
        else:
            request['styles'] = ''

draro avatar Jan 01 '21 11:01 draro

The and len(styles) > 0 is not needed, an empty array is considered as False...

sbrunner avatar Jan 01 '21 11:01 sbrunner

The and len(styles) > 0 is not needed, an empty array is considered as False...

Thanks, you are right.

draro avatar Jan 01 '21 12:01 draro