[OWSLib-users] WMS: error getting layers whith blanks in layer name

Tom Kralidis tom.kralidis at gmail.com
Wed Oct 10 04:18:30 PDT 2018


Hi Mauro: thanks for the info.  I think the layer name needs to be DTM_5X5:

>>> from owslib.wms import WebMapService
>>> w=WebMapService('http://www.cartografia.servizirl.it/arcgis/services/wms/DTM5_RL_wms/MapServer/WMSServer')
>>> w.contents
OrderedDict([('DTM_5X5', <owslib.map.wms111.ContentMetadata object at
0xb69ba98c>), ('Isoipse', <owslib.map.wms111.ContentMetadata object at
0xb69baa0c>), ('Perimetrazione_fonti',
<owslib.map.wms111.ContentMetadata object at 0xb69bab8c>)])
>>> w.contents.keys()
['DTM_5X5', 'Isoipse', 'Perimetrazione_fonti']
>>>

..Tom



On Wed, Oct 10, 2018 at 3:42 AM MUSSIN MAURO <M.MUSSIN at arpalombardia.it> wrote:
>
> This works:
>
> from owslib.wms import WebMapService
>
> wms=WebMapService('http://www.cartografia.servizirl.it/arcgis/services/wms/DTM5_RL_wms/MapServer/WMSServer')
>
> img=wms.getmap(layers=["Isoipse"],styles=['default'],srs='EPSG:4326',bbox=(8.48,44.65,11.50,46.64),size=(300,300),format='image/png')
>
> nessun problema
>
>
>
> This does not:
>
> from owslib.wms import WebMapService
>
> wms=WebMapService('http://www.cartografia.servizirl.it/arcgis/services/wms/DTM5_RL_wms/MapServer/WMSServer')
>
> img=wms.getmap(layers=["DTM 5X5"],styles=['default'],srs='EPSG:4326',bbox=(8.48,44.65,11.50,46.64),size=(300,300),format='image/png')
>
> ServiceException: Parameter 'layers' contains unacceptable layer names.
>
>
>
> I’ve tried to put the %20 instead of blank or \s but nothing works.
>
> Somewhere I’ve read that this is a known bug: any info about fixing?
>
>
>
> In folium everithing works fine (but the HTML doc is too heavy for my needs so I have to work with basemap and owslib)
>
>
>
> Any help appreciated.
>
>
>
> Mauro Mussin
> Gestione reti idro-meteo
> U.O. Servizio meteorologico e rete idro-meteo regionale
> via Rosellini 17 - Milano
> 0269666425 - VOIP 69425
>
>
>
> _______________________________________________
> OWSLib-users mailing list
> OWSLib-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/owslib-users


More information about the OWSLib-users mailing list