Skip to content

KeyError: 'bbox'  #104

@philvarner

Description

@philvarner

Sorry I don't have a more precise use case here. I'm running stac-api-validator against tamn.snapplanet.io/, and I don't know which item this occurs against.

The stacktrace is:

File "/Users/philvarner/code/stac-api-validator/.venv/lib/python3.10/site-packages/stac_check/lint.py", line 42, in __post_init__
    self.best_practices_msg = self.create_best_practices_msg()
  File "/Users/philvarner/code/stac-api-validator/.venv/lib/python3.10/site-packages/stac_check/lint.py", line 271, in create_best_practices_msg
    for _,v in self.create_best_practices_dict().items():
  File "/Users/philvarner/code/stac-api-validator/.venv/lib/python3.10/site-packages/stac_check/lint.py", line 230, in create_best_practices_dict
    if self.check_unlocated() and config["check_unlocated"] == True:
  File "/Users/philvarner/code/stac-api-validator/.venv/lib/python3.10/site-packages/stac_check/lint.py", line 131, in check_unlocated
    return self.data["geometry"] is None and self.data["bbox"] is not None
KeyError: 'bbox'

My guess is that this is because bbox is only required if geometry is null, so this line should be more defensive like return self.data.get("geometry") is None and self.data.get("bbox") is not None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions