-
Notifications
You must be signed in to change notification settings - Fork 27
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
/search
ing by date and/or datetime and/or datetime+ms
#178
Comments
Hi @jgaucher-cs It would help if you state which backend you are using, some backend might have specificities.
You can use start/end dates in form of
Well the Spec mention date in a specific format so for the implementation we are trying to follow the spec to the letter, but you can customized your own app, as Microsoft is doing: https://github.com/microsoft/planetary-computer-apis/blob/155f5f6de9ae6a09d29f53cbdd2ab4b7215a3b1f/pcstac/pcstac/search.py#L37-L41
I'm not sure to get this. Let's follow the
iso8601.parse_date("2000-01-01T01:01:01.001Z").microsecond So I'm not quite sure about the statement |
Thank you very much @vincentsarago for your answer. I'm using the pgstac backend. I will take a look at this customization for searching by date. For the ms, the str to datetime conversion with Allow me to paste a screenshot from my call stack, I've called my endpoint with `/search?datetime=2000-01-01T01:01:01.000Z", then in: /stac_fastapi/pgstac/core.py This A little before in the call stack, we see that |
Can you share the version of stac-fastapi, stac-fastapi-pgstac and stac-pydantic please |
|
Hello @vincentsarago, would you have any update on this ? Thank you :) |
sorry @jgaucher-cs just got back from vacations, I'll try to have a look this week |
🤔 in stac-utils/stac-fastapi#771 I've added more tests about |
Thank you @vincentsarago for your feedback. Are you still looking at this ? Should I copy this issue in https://github.com/stac-utils/stac-fastapi-pgstac/issues ? |
@jgaucher-cs transferred the issue here! I've got other things on my todo right now but will try to go back at this as soon as I can |
Hi, when calling the /search endpoint that is implemented here: https://github.com/stac-utils/stac-fastapi/blob/main/stac_fastapi/api/stac_fastapi/api/app.py, it seems we cannot search by date, but only by datetime.
A GET request with
/search?datetime=2000-01-01
will fail with this error from https://github.com/stac-utils/stac-fastapi/blob/main/stac_fastapi/types/stac_fastapi/types/rfc3339.pyA POST request will fail with what seems to by a pydantic error:
We would like to allow our users to search by date without time, then our application (that uses stac_fastapi) would return all products for this whole day. Would this be possible ?
Then we would like to do the same for milliseconds: our products have a ms information, so if the user searches by datetime+ms, we would like to return products only for this specific ms. If he searches by datetime without ms, we would like to return all products for this whole second.
Our problem is that, if he searches for ms=.000 (to have products only for this specific ms) with a GET request e.g.
/search?datetime=2000-01-01T01:01:01.000Z
, stac_fastpi removes the ms=.000 information: our app receives the valuedatetime=2000-01-01T01:01:01Z
, so it doesn't know anymore if the user wanted only products for this specific ms, or for this whole second. I think this removal is made when stac_fastapi converts the str to datetime inrfc3339_str_to_datetime
https://github.com/stac-utils/stac-fastapi/blob/main/stac_fastapi/types/stac_fastapi/types/rfc3339.py#L51 (I couldn't find where this datetime is converted back to str).To summarize, my two questions are:
Thank you :)
The text was updated successfully, but these errors were encountered: