In [98]:
from owslib.wms import WebMapService
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
In [99]:
wms=WebMapService('http://mapy.geoportal.gov.pl/wss/service/img/guest/Administracyjna/MapServer/WMSServer')
In [100]:
img = wms.getmap(layers=['Administracyjna'],styles=['default'],srs='EPSG:4326',bbox=(21.00,52.00,21+1,52+1),size=(800,600),format='image/jpeg',transparent=False)
In [101]:
out=open('obrazek.jpg','wb')
In [102]:
out.write(img.read())
out.close()
In [103]:
obr=mpimg.imread('obrazek.jpg')
imgplot = plt.imshow(obr)
plt.show()