Skip to content

Commit

Permalink
Merge 3561039 into 8c4537f
Browse files Browse the repository at this point in the history
  • Loading branch information
wphyojpl authored Jan 7, 2025
2 parents 8c4537f + 3561039 commit 5223e52
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
17 changes: 13 additions & 4 deletions cumulus_lambda_functions/lib/uds_db/granules_db_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,21 @@ def __init__(self):

@staticmethod
def to_es_bbox(bbox_array):
minX, minY, maxX, maxY = bbox_array

# Ensure the values are properly sorted
if minX > maxX:
minX, maxX = maxX, minX
if minY > maxY:
minY, maxY = maxY, minY

return {
"type": "envelope",
"coordinates": [
[bbox_array[0], bbox_array[3]], # Top-left corner (minLon, maxLat)
[bbox_array[2], bbox_array[1]] # Bottom-right corner (maxLon, minLat)
]
"coordinates": [[minX, maxY], [maxX, minY]],
# "coordinates": [
# [bbox_array[0], bbox_array[3]], # Top-left corner (minLon, maxLat)
# [bbox_array[2], bbox_array[1]] # Bottom-right corner (maxLon, minLat)
# ]
}

@staticmethod
Expand Down
3 changes: 2 additions & 1 deletion tests/integration_tests/test_stage_out_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ def test_03_upload_complete_catalog_role_as_key(self):
"type": "Point",
"coordinates": [0.0, 0.0]
},
bbox=[0.0, 0.0, 0.1, 0.1],
# bbox=[0.0, 0.0, 0.1, 0.1],
bbox=[0.1, 0.1, 0.0, 0.0], # Testing invalid geo-shape
datetime=TimeUtils().parse_from_unix(0, True).get_datetime_obj(),
properties={
"start_datetime": "2016-01-31T18:00:00.009057Z",
Expand Down

0 comments on commit 5223e52

Please sign in to comment.