Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions pygeoapi/provider/tinydb_.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2025 Tom Kralidis
# Copyright (c) 2026 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -448,7 +448,7 @@ def __repr__(self):
return f'<TinyDBCatalogueProvider> {self.data}'


def bbox_intersects(record_geometry, input_bbox):
def bbox_intersects(record_geometry, input_bbox) -> bool:
"""
Manual bbox intersection calculation

Expand All @@ -458,7 +458,15 @@ def bbox_intersects(record_geometry, input_bbox):
:returns: `bool` of whether the record_bbox intersects input_bbox
"""

bbox1 = list(shape(record_geometry).bounds)
if record_geometry is None:
LOGGER.debug('Record geometry is none; skipping')
return False

try:
bbox1 = list(shape(record_geometry).bounds)
except Exception as err:
LOGGER.debug(f'Invalid geometry: {err}')
return False

bbox2 = [float(c) for c in input_bbox.split(',')]

Expand Down
5 changes: 5 additions & 0 deletions tests/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,8 @@ This directory provides test data to demonstrate functionality.
- source: [Canadian National Water Data Archive](https://www.canada.ca/en/environment-climate-change/services/water-overview/quantity/monitoring/survey/data-products-services/national-archive-hydat.html) as extracted from the [MSC GeoMet OGC API](https://eccc-msc.github.io/open-data/msc-geomet/web-services_en/#ogc-api-features) service
- URL: https://www.canada.ca/en/environment-climate-change/services/water-overview/quantity/monitoring/survey/data-products-services/national-archive-hydat.html
- License: https://eccc-msc.github.io/open-data/licence/readme_en

### `dutch-nationaalgeoregister/sample-records.tinydb`
- source: Dutch National Georegister
- URL: https://nationaalgeoregister.nl
- License: CC0: https://creativecommons.org/share-your-work/public-domain/cc0
Loading