Skip to content

Commit 3b4fca0

Browse files
committed
- simplified code
1 parent 4710fc7 commit 3b4fca0

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎pygeoapi/provider/mapscript_.py‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,13 @@ def query(self, style=None, bbox=[], width=500, height=300,
155155

156156
try:
157157

158-
wms_crs = get_curie(crs)
158+
curie = get_curie(crs)
159159

160-
LOGGER.debug(f'Mapscript will use: {wms_crs}')
160+
LOGGER.debug(f'Mapscript will use: {curie}')
161161

162162
# The bbox is already reprojected on the base class
163-
map_bbox = bbox
164-
165-
if wms_crs not in ['CRS:84', 'EPSG:4326']:
166-
epsg_code_str = wms_crs.split(":")[-1].strip()
167-
epsg_code = int(epsg_code_str)
163+
if curie not in ['CRS:84', 'EPSG:4326']:
164+
epsg_code = int(curie.split(":")[-1].strip())
168165
map_crs = self._epsg2projstring(epsg_code)
169166
self._map.units = mapscript.MS_METERS
170167
else:
@@ -191,7 +188,7 @@ def query(self, style=None, bbox=[], width=500, height=300,
191188
fmt.transparent = mapscript.MS_OFF
192189

193190
self._map.setOutputFormat(fmt)
194-
self._map.setExtent(*map_bbox)
191+
self._map.setExtent(*bbox)
195192
self._map.setSize(width, height)
196193

197194
self._map.setProjection(map_crs)

0 commit comments

Comments
 (0)