Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'bbox' #104

Open
philvarner opened this issue Feb 24, 2023 · 1 comment
Open

KeyError: 'bbox' #104

philvarner opened this issue Feb 24, 2023 · 1 comment

Comments

@philvarner
Copy link
Collaborator

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

@jonhealy1
Copy link
Collaborator

Ok thanks for the feedback. I will make the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants