-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaerotriangulacja_api.py
31 lines (27 loc) · 1007 Bytes
/
aerotriangulacja_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
from .constants import AEROTRAINGULACJA_WMS_URL, AEROTRAINGULACJA_SKOROWIDZE_LAYERS
from .wms.utils import get_wms_objects
from . import service_api
def getAerotriangulacjaListbyPoint1992(point):
"""Zwraca listę dostępnych do pobrania areotriangulacji na podstawie
zapytania GetFeatureInfo z usługi WMS"""
x = point.x()
y = point.y()
PARAMS = {
'SERVICE': 'WMS',
'request': 'GetFeatureInfo',
'version': '1.1.1',
'layers': ','.join(AEROTRAINGULACJA_SKOROWIDZE_LAYERS),
'styles': '',
'srs': 'EPSG:2180',
'bbox': '%f,%f,%f,%f' % (x-50, y-50, x+50, y+50),
'width': '101',
'height': '101',
'format': 'image/png',
'transparent': 'true',
'query_layers': ','.join(AEROTRAINGULACJA_SKOROWIDZE_LAYERS),
'i': '50',
'j': '50',
'INFO_FORMAT': 'text/html'
}
resp = service_api.getRequest(params=PARAMS, url=AEROTRAINGULACJA_WMS_URL)
return get_wms_objects(resp)