Skip to content

Commit

Permalink
round lat/lon to avoid error in python-cmr
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Feb 11, 2024
1 parent 42fcd43 commit 291bbf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion titiler/cmr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from rio_tiler.mosaic import mosaic_reader
from rio_tiler.types import BBox

from titiler.cmr.logger import logger
from titiler.cmr.settings import AuthSettings, CacheSettings, RetrySettings
from titiler.cmr.utils import retry

Expand Down Expand Up @@ -164,12 +165,14 @@ def get_assets(
) -> List[Asset]:
"""Find assets."""
try:
xmin, ymin, xmax, ymax = (round(n, 8) for n in [xmin, ymin, xmax, ymax])
results = earthaccess.search_data(
bounding_box=(xmin, ymin, xmax, ymax),
count=limit,
**kwargs,
)
except RuntimeError:
except RuntimeError as e:
logger.debug(repr(e))
return []

assets: List[Asset] = []
Expand Down
5 changes: 5 additions & 0 deletions titiler/cmr/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""titiler-cmr logger."""

import logging

logger = logging.getLogger("titiler-cmr")

0 comments on commit 291bbf7

Please sign in to comment.