opengis: reduce feature info area even more (#34410)

This commit is contained in:
Frédéric Péters 2019-06-28 08:04:01 +02:00
parent 486f090179
commit 6147f7e2ac
2 changed files with 5 additions and 7 deletions

View File

@ -219,17 +219,15 @@ class OpenGIS(BaseResource):
})
def feature_info(self, request, lat, lon):
lat, lon = float(lat), float(lon)
bbox = self.get_bbox(lon - 0.001, lat - 0.001, lon + 0.001, lat + 0.001)
bbox = self.get_bbox(lon - 0.0001, lat - 0.0001, lon + 0.0001, lat + 0.0001)
params = {
'VERSION': '1.3.0',
'SERVICE': 'WMS',
'REQUEST': 'GetFeatureInfo',
'INFO_FORMAT': 'application/vnd.ogc.gml',
'STYLES': '',
'I': '0',
'J': '0',
'HEIGHT': '20',
'WIDTH': '20',
'I': '24', 'J': '24', # pixel in the middle of
'HEIGHT': '50', 'WIDTH': '50', # a 50x50 square
'CRS': self.projection,
'LAYERS': self.query_layer,
'QUERY_LAYERS': self.query_layer,

View File

@ -246,7 +246,7 @@ def test_feature_info(mocked_get, app, connector):
assert endpoint == '/opengis/test/feature_info'
mocked_get.return_value = utils.FakedResponse(content=FAKE_FEATURE_INFO, status_code=200)
resp = app.get(endpoint, params={'lat': '45.796890', 'lon': '4.784140'})
assert mocked_get.call_args[1]['params']['BBOX'] == '532456.709193,5747700.5636,532679.348175,5748019.89478'
assert mocked_get.call_args[1]['params']['BBOX'] == '532556.896735,5747844.26121,532579.160633,5747876.19433'
assert mocked_get.call_args[1]['params']['CRS'] == 'EPSG:3857'
assert (resp.json['data']
['cad_cadastrecadparcelle_layer']
@ -256,7 +256,7 @@ def test_feature_info(mocked_get, app, connector):
connector.projection = 'EPSG:4326'
connector.save()
resp = app.get(endpoint, params={'lat': '45.796890', 'lon': '4.784140'})
assert mocked_get.call_args[1]['params']['BBOX'] == '45.79589,4.78314,45.79789,4.78514'
assert mocked_get.call_args[1]['params']['BBOX'] == '45.79679,4.78404,45.79699,4.78424'
assert mocked_get.call_args[1]['params']['CRS'] == 'EPSG:4326'