diff --git a/owslib/coverage/wcs110.py b/owslib/coverage/wcs110.py index 053a2bfe..0828d775 100644 --- a/owslib/coverage/wcs110.py +++ b/owslib/coverage/wcs110.py @@ -176,7 +176,7 @@ def getCoverage(self, identifier=None, bbox=None, time=None, format=None, store= request['identifier'] = identifier # request['identifier'] = ','.join(identifier) if bbox: - request['boundingbox'] = ','.join([repr(x) for x in bbox]) + request['boundingbox'] = ','.join([str(x) for x in bbox]) if time: request['timesequence'] = ','.join(time) request['format'] = format diff --git a/owslib/feature/wfs100.py b/owslib/feature/wfs100.py index f3c8ca04..4dd8db7b 100644 --- a/owslib/feature/wfs100.py +++ b/owslib/feature/wfs100.py @@ -268,7 +268,7 @@ def getfeature( if featureid: request["featureid"] = ",".join(featureid) elif bbox and typename: - request["bbox"] = ",".join([repr(x) for x in bbox]) + request["bbox"] = ",".join([str(x) for x in bbox]) elif filter and typename: request["filter"] = str(filter) diff --git a/owslib/map/wms111.py b/owslib/map/wms111.py index 24a9b2d3..2e1314ab 100644 --- a/owslib/map/wms111.py +++ b/owslib/map/wms111.py @@ -172,7 +172,7 @@ def __build_getmap_request(self, layers=None, styles=None, srs=None, bbox=None, request['height'] = str(size[1]) request['srs'] = str(srs) - request['bbox'] = ','.join([repr(x) for x in bbox]) + request['bbox'] = ','.join([str(x) for x in bbox]) request['format'] = str(format) request['transparent'] = str(transparent).upper() request['exceptions'] = str(exceptions) diff --git a/owslib/map/wms130.py b/owslib/map/wms130.py index 07efe910..7cdfbdcc 100644 --- a/owslib/map/wms130.py +++ b/owslib/map/wms130.py @@ -182,7 +182,7 @@ def __build_getmap_request(self, layers=None, styles=None, srs=None, bbox=None, # remapping the srs to crs for the request request['crs'] = str(srs) - request['bbox'] = ','.join([repr(x) for x in bbox]) + request['bbox'] = ','.join([str(x) for x in bbox]) request['format'] = str(format) request['transparent'] = str(transparent).upper() request['exceptions'] = str(exceptions) diff --git a/tests/test_wms_getmap.py b/tests/test_wms_getmap.py index b57fa33d..34631bfa 100644 --- a/tests/test_wms_getmap.py +++ b/tests/test_wms_getmap.py @@ -4,6 +4,7 @@ from tests.utils import service_ok from owslib.wms import WebMapService +from owslib.map.wms130 import WebMapService_1_3_0 from owslib.util import ServiceException from owslib.util import ResponseWrapper @@ -12,6 +13,26 @@ NCWMS2_URL = "http://wms.stccmop.org:8080/ncWMS2/wms" +@pytest.fixture +def wms(): + return WebMapService_1_3_0(SERVICE_URL, version='1.3.0') + + +def test_build_getmap_request_bbox_precision(wms): + bbox = (-126.123456789, 24.123456789, -66.123456789, 50.123456789) + bbox_yx = (bbox[1], bbox[0], bbox[3], bbox[2]) + request = wms._WebMapService_1_3_0__build_getmap_request( + layers=['layer1'], + styles=['default'], + srs='EPSG:4326', + bbox=bbox, + format='image/jpeg', + size=(250, 250), + transparent=True + ) + assert request['bbox'] == ','.join(map(str, bbox_yx)) + + @pytest.mark.online @pytest.mark.skipif(not service_ok(SERVICE_URL), reason="WMS service is unreachable")