In [117]:
from owslib.wms import WebMapService
wms = WebMapService('http://mapy.geoportal.gov.pl/wss/service/img/guest/ORTO/MapServer/WMSServer', version='1.1.1')
In [118]:
wms.identification.type
Out[118]:
In [119]:
wms.identification.title
Out[119]:
In [120]:
list(wms.contents)
Out[120]:
In [121]:
wms['Raster'].title
Out[121]:
In [122]:
wms['Raster'].title
Out[122]:
In [123]:
wms['Raster'].queryable
Out[123]:
In [124]:
wms['Raster'].opaque
Out[124]:
In [125]:
wms['Raster'].boundingBox
Out[125]:
In [126]:
wms['Raster'].boundingBoxWGS84
Out[126]:
In [127]:
wms['Raster'].crsOptions
Out[127]:
In [128]:
wms['Raster'].styles
Out[128]:
In [141]:
bbox=( 20+29/60+28/3600,53+46/60+55/3600,20+30/60+13/3600, 53+47/60+10/3600)
print (bbox)
In [148]:
img = wms.getmap(layers=['Raster'],styles=['default'],srs='EPSG:4326',
bbox=bbox,
size=(300, 250),
format='image/jpeg',
transparent=True
)
In [149]:
import matplotlib.pyplot as plt
In [150]:
a=img.read()
In [151]:
out = open('tmp.jpg', 'wb')
out.write(img.read())
out.close()
In [152]:
import matplotlib.image as mpimg
fig, ax = plt.subplots(figsize=(20, 10))
img=mpimg.imread('tmp.jpg')
imgplot = plt.imshow(img)
plt.show()