-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathortofoto_api.py
32 lines (28 loc) · 969 Bytes
/
ortofoto_api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from .constants import ORTOFOTOMAPA_WMS_URL
from .wms.utils import get_wms_objects
from . import service_api
def getOrtoListbyPoint1992(point):
"""Zwraca listę dostępnych do pobrania ortofotomap na podstawie
zapytania GetFeatureInfo z usługi WMS"""
x = point.x()
y = point.y()
layers = service_api.getAllLayers(url=ORTOFOTOMAPA_WMS_URL, service='WMS')
PARAMS = {
'SERVICE': 'WMS',
'request': 'GetFeatureInfo',
'version': '1.3.0',
'layers': ','.join(layers),
'styles': '',
'crs': 'EPSG:2180',
'bbox': '%f,%f,%f,%f' % (y-50, x-50, y+50, x+50),
'width': '101',
'height': '101',
'format': 'image/png',
'transparent': 'true',
'query_layers': ','.join(layers),
'i': '50',
'j': '50',
'INFO_FORMAT': 'text/html'
}
resp = service_api.getRequest(params=PARAMS, url=ORTOFOTOMAPA_WMS_URL)
return get_wms_objects(resp)