Skip to content

Commit 82486ec

Browse files
committed
Remove links when loading GeoJSON by provider, use debug logging for unknown locales, flake8
1 parent c8955b4 commit 82486ec

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

pygeoapi/api/joins.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -680,13 +680,7 @@ def join_details(api: API, request: APIRequest,
680680
'rel': 'items',
681681
'title': 'Items with joined data as GeoJSON',
682682
'href': f"{uri}/items?f={F_JSON}&joinId={join_id}",
683-
}, {
684-
# TODO
685-
# 'type': FORMAT_TYPES[F_JSONLD],
686-
# 'rel': 'items',
687-
# 'title': 'Items with joined data as RDF (JSON-LD)',
688-
# 'href': f"{uri}/items?f={F_JSONLD}&joinId={join_id}", # noqa
689-
# }, {
683+
}, { # TODO: RDF/JSON-LD
690684
'type': FORMAT_TYPES[F_HTML],
691685
'rel': 'items',
692686
'title': 'Items with joined data items as HTML',
@@ -817,13 +811,7 @@ def create_join(api: API, request: APIRequest,
817811
'rel': 'items',
818812
'title': 'Items with joined data as GeoJSON',
819813
'href': f"{uri}/items?f={F_JSON}&joinId={details['id']}", # noqa
820-
}, {
821-
# TODO
822-
# 'type': FORMAT_TYPES[F_JSONLD],
823-
# 'rel': 'items',
824-
# 'title': 'Items with joined data as RDF (JSON-LD)',
825-
# 'href': f"{uri}/items?f={F_JSONLD}&joinId={details['id']}", # noqa
826-
# }, {
814+
}, { # TODO: RDF/JSON-LD
827815
'type': FORMAT_TYPES[F_HTML],
828816
'rel': 'items',
829817
'title': 'Items with joined data as HTML',

pygeoapi/l10n.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def str2locale(value: str, silent: bool = False) -> Union[Locale, None]:
8484
if not silent:
8585
raise LocaleError(f"invalid locale '{value}'")
8686
except _UnknownLocaleError as err:
87-
LOGGER.warning(err)
87+
LOGGER.debug(err)
8888
if not silent:
8989
raise LocaleError(err)
9090
else:

pygeoapi/provider/geojson.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ def _load(self, bbox=[], skip_geometry=None, properties=[],
119119
# Must be a FeatureCollection
120120
assert data['type'] == 'FeatureCollection'
121121

122+
# Remove links: this can mess up pygeoapi (as it also adds them)
123+
if 'links' in data:
124+
LOGGER.debug(f'removing links from {self.name} FeatureCollection')
125+
del data['links']
126+
for f in data['features']:
127+
LOGGER.debug(f'removing links from {self.name} features')
128+
if 'links' in f:
129+
del f['links']
130+
122131
# filter by properties if set
123132
if properties:
124133
data['features'] = [f for f in data['features'] if \

0 commit comments

Comments
 (0)