|
13 | 13 | from opensearchpy import exceptions, helpers |
14 | 14 | from opensearchpy.helpers.query import Q |
15 | 15 | from opensearchpy.helpers.search import Search |
| 16 | +from starlette.requests import Request |
| 17 | + |
16 | 18 | from stac_fastapi.core.base_database_logic import BaseDatabaseLogic |
17 | 19 | from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer |
18 | 20 | from stac_fastapi.core.utilities import bbox2polygon, get_max_limit |
|
25 | 27 | AsyncOpensearchSettings as AsyncSearchSettings, |
26 | 28 | ) |
27 | 29 | from stac_fastapi.opensearch.config import OpensearchSettings as SyncSearchSettings |
| 30 | +from stac_fastapi.sfeos_helpers import filter as filter_module |
28 | 31 | from stac_fastapi.sfeos_helpers.database import ( |
29 | 32 | apply_free_text_filter_shared, |
30 | 33 | apply_intersects_filter_shared, |
|
64 | 67 | from stac_fastapi.types.errors import ConflictError, NotFoundError |
65 | 68 | from stac_fastapi.types.links import resolve_links |
66 | 69 | from stac_fastapi.types.stac import Collection, Item |
67 | | -from starlette.requests import Request |
68 | | - |
69 | | -from stac_fastapi.sfeos_helpers import filter as filter_module |
70 | 70 |
|
71 | 71 | logger = logging.getLogger(__name__) |
72 | 72 |
|
@@ -388,17 +388,19 @@ def apply_bbox_filter(search: Search, bbox: List): |
388 | 388 | a geo_shape filter is added to the search object, set to intersect with the specified polygon. |
389 | 389 | """ |
390 | 390 | return search.filter( |
391 | | - Q({ |
392 | | - "geo_shape": { |
393 | | - "geometry": { |
394 | | - "shape": { |
395 | | - "type": "polygon", |
396 | | - "coordinates": bbox2polygon(*bbox), |
397 | | - }, |
398 | | - "relation": "intersects", |
| 391 | + Q( |
| 392 | + { |
| 393 | + "geo_shape": { |
| 394 | + "geometry": { |
| 395 | + "shape": { |
| 396 | + "type": "polygon", |
| 397 | + "coordinates": bbox2polygon(*bbox), |
| 398 | + }, |
| 399 | + "relation": "intersects", |
| 400 | + } |
399 | 401 | } |
400 | 402 | } |
401 | | - }) |
| 403 | + ) |
402 | 404 | ) |
403 | 405 |
|
404 | 406 | @staticmethod |
|
0 commit comments