In [ ]:
from owslib.wms import WebMapService
wms = WebMapService('http://mapy.geoportal.gov.pl/wss/service/img/guest/ORTO/MapServer/WMSServer', version='1.1.1')

In [ ]:
wms.identification.type

In [ ]:
wms.identification.title

In [ ]:
list(wms.contents)

In [ ]:
wms['Raster'].title

In [ ]:
wms['Raster'].title

In [ ]:
wms['Raster'].queryable

In [ ]:
wms['Raster'].opaque

In [ ]:
wms['Raster'].boundingBox

In [ ]:
wms['Raster'].boundingBoxWGS84

In [ ]:
wms['Raster'].crsOptions

In [ ]:
wms['Raster'].styles

In [ ]:
bbox=( 20+29/60+28/3600,53+46/60+55/3600,20+30/60+13/3600, 53+47/60+10/3600)
print (bbox)

In [ ]:
img = wms.getmap(layers=['Raster'],styles=['default'],srs='EPSG:4326',
bbox=bbox,
size=(300, 250),
format='image/jpeg',
transparent=True
)

In [ ]:
import matplotlib.pyplot as plt

In [ ]:
a=img.read()

In [ ]:
out = open('tmp.jpg', 'wb')
out.write(img.read())
out.close()

In [ ]:
import matplotlib.image as mpimg
fig, ax = plt.subplots(figsize=(20, 10))
img=mpimg.imread('tmp.jpg')
imgplot = plt.imshow(img)
plt.show()

In [ ]: