Skip to content

Commit 73fc73a

Browse files
committed
revert bbox to polygon
1 parent e530e06 commit 73fc73a

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from elasticsearch import exceptions, helpers # type: ignore
1212
from stac_fastapi.core.extensions import filter
1313
from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer
14+
from stac_fastapi.core.utilities import bbox2polygon
1415
from stac_fastapi.elasticsearch.config import AsyncElasticsearchSettings
1516
from stac_fastapi.elasticsearch.config import (
1617
ElasticsearchSettings as SyncElasticsearchSettings,
@@ -229,21 +230,6 @@ async def delete_item_index(collection_id: str):
229230
await client.close()
230231

231232

232-
def bbox2polygon(b0: float, b1: float, b2: float, b3: float) -> List[List[List[float]]]:
233-
"""Transform a bounding box represented by its four coordinates `b0`, `b1`, `b2`, and `b3` into a polygon.
234-
235-
Args:
236-
b0 (float): The x-coordinate of the lower-left corner of the bounding box.
237-
b1 (float): The y-coordinate of the lower-left corner of the bounding box.
238-
b2 (float): The x-coordinate of the upper-right corner of the bounding box.
239-
b3 (float): The y-coordinate of the upper-right corner of the bounding box.
240-
241-
Returns:
242-
List[List[List[float]]]: A polygon represented as a list of lists of coordinates.
243-
"""
244-
return [[[b0, b1], [b2, b1], [b2, b3], [b0, b3], [b0, b1]]]
245-
246-
247233
def mk_item_id(item_id: str, collection_id: str):
248234
"""Create the document id for an Item in Elasticsearch.
249235

0 commit comments

Comments
 (0)