Skip to content

Commit 7f467ad

Browse files
committed
- fixed flake8 errors
1 parent c9fbbd9 commit 7f467ad

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎pygeoapi/api/maps.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import logging
4545
from typing import Tuple
4646

47-
from pygeoapi.crs import transform_bbox, DEFAULT_CRS, get_crs_curie, get_crs_uri
47+
from pygeoapi.crs import transform_bbox, DEFAULT_CRS, get_crs_uri
4848
from pygeoapi.formats import F_JSON, FORMAT_TYPES
4949
from pygeoapi.openapi import get_oas_30_parameters
5050
from pygeoapi.plugin import load_plugin
@@ -64,6 +64,7 @@
6464

6565
DEFAULT_BBOX = [-180, -90, 180, 90] # CRS84
6666

67+
6768
def get_collection_map(api: API, request: APIRequest,
6869
dataset: str, style: str | None = None
6970
) -> Tuple[dict, int, str]:
@@ -111,9 +112,9 @@ def get_collection_map(api: API, request: APIRequest,
111112
try:
112113
if 'crs' not in request.params:
113114
query_args['crs'] = collection_def.get('storage_crs',
114-
DEFAULT_CRS)
115+
DEFAULT_CRS)
115116
else:
116-
query_args['crs'] = get_crs_uri(request.params['crs'])
117+
query_args['crs'] = get_crs_uri(request.params['crs'])
117118

118119
except KeyError:
119120
query_args['crs'] = DEFAULT_CRS
@@ -173,7 +174,7 @@ def get_collection_map(api: API, request: APIRequest,
173174
LOGGER.error(exception)
174175
return headers, HTTPStatus.BAD_REQUEST, to_json(
175176
exception, api.pretty_print)
176-
177+
177178
# the transformer function expects the crs to be in a uri format
178179
if query_args['bbox-crs'] != query_args['crs']:
179180
bbox = transform_bbox(bbox, query_args['bbox-crs'],

‎pygeoapi/crs.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def get_supported_crs_list(
121121

122122
return supported_crs_list
123123

124+
124125
def get_crs_uri(str) -> str:
125126
"""
126127
Parse a uri from a uri, a curie or a safe curie
@@ -171,16 +172,14 @@ def get_crs_uri(str) -> str:
171172
raise CRSError('Unsupported crs')
172173

173174
if curie in ['crs84', 'ogc:crs84']:
174-
LOGGER.debug(f'Returning CRS84')
175175
return 'http://www.opengis.net/def/crs/OGC/1.3/CRS84'
176176

177-
LOGGER.debug(f'Returning: http://www.opengis.net/def/crs/EPSG/0/{curie_el[1]}')
178177
return f'http://www.opengis.net/def/crs/EPSG/0/{curie_el[1]}'
179178

180179
except CRSError as e:
181180
return e
182181

183-
182+
184183
def get_crs_curie(str) -> str:
185184
"""
186185
Get a wms compatible crs curie from a uri
@@ -202,7 +201,7 @@ def get_crs_curie(str) -> str:
202201
raise CRSError('Not an uri')
203202

204203
str = str.lower()
205-
path_el = [p for p in str.split('/') if p]
204+
path_el = [p for p in str.split('/') if p]
206205

207206
# We support all EPSG crs and CRS84
208207
if path_el[4] == 'epsg':

‎pygeoapi/provider/wms_facade.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
DEFAULT_WMS_CRS = 'CRS:84'
5050

51+
5152
class WMSFacadeProvider(BaseProvider):
5253
"""WMS 1.3.0 provider"""
5354

@@ -64,9 +65,9 @@ def __init__(self, provider_def):
6465

6566
LOGGER.debug(f'pyproj version: {pyproj.__version__}')
6667

67-
def query(self, style=None, bbox=[-180, -90, 180, 90], width=500,
68-
height=300, crs=DEFAULT_WMS_CRS, datetime_=None, transparent=True,
69-
format_='png', **kwargs):
68+
def query(self, style=None, bbox=[-180, -90, 180, 90],
69+
width=500, height=300, crs=DEFAULT_WMS_CRS, datetime_=None,
70+
transparent=True, format_='png', **kwargs):
7071
"""
7172
Generate map
7273

0 commit comments

Comments
 (0)