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

Item output is missing start_datetime and end_datetime #960

Open
aripollak opened this issue Sep 21, 2021 · 4 comments
Open

Item output is missing start_datetime and end_datetime #960

aripollak opened this issue Sep 21, 2021 · 4 comments

Comments

@aripollak
Copy link

Describe the bug

If an input STAC item has start_datetime and end_datetime properties, like:

  "properties": {
    "datetime": "2011-01-01T00:00:00Z",
    "description": "BCSD surface water projections hydrologic data",
    "end_datetime": "2064-01-16T00:00:00",
    "start_datetime": "2064-01-16T00:00:00",
    "title": "sresb1.ukmo_hadcm3.1.monthly.swe.2064",
    "units": "mm"
  },

When requesting the item from Franklin, the start/end are missing:

{
  "properties": {
    "units": "mm",
    "datetime": "2011-01-01T00:00:00Z",
    "title": "sresb1.ukmo_hadcm3.1.monthly.swe.2064",
    "description": "BCSD surface water projections hydrologic data"
  }

Expected behavior
I think start_datetime and end_datetime should be in the item STAC shown in Franklin.

@jisantuc
Copy link
Contributor

!!!!

That's definitely a bug. We round trip test items with point-in-time datetimes and datetime ranges (generator is here), so this definitely seems like a Franklin problem. Thanks for the report!

@jisantuc
Copy link
Contributor

Oh, nevermind, I see what happened here. The spec says:

Important: Using one of the fields REQUIRES inclusion of the other field as well to enable a user to search STAC records by the provided times. So if you use start_datetime you need to add end_datetime and vice-versa. Both fields are also REQUIRED if the datetime field is set to null. The datetime property in a STAC Item and these fields are not mutually exclusive.

But we decode the incoming JSON to either have a point-in-time datetime or to have a time range (we're using Either when we should be using something like These). I'll fix this upstream in stac4s

@aripollak
Copy link
Author

Thanks! Is it now just a matter of updating to the latest stac4s?

@jisantuc
Copy link
Contributor

jisantuc commented Oct 1, 2021

Yup, I have a PR up to do that but I started failing a test because filtering isn't working quite as expected now 😨 and I haven't had a chance to dig in yet. It's covered as part of #930

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