-
Notifications
You must be signed in to change notification settings - Fork 51
Numeric queries (e.g. gsd=n
) don't work
#80
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
Comments
This would be easier if the user passed in query via a dictionary, like it actually gets sent to the API. This problem is due to the short-hand notation here of "NAME=VAL" strings. I'm thinking:
|
Actually, this could be more a server-side issue. It works with stac-server:
Because the data type is specified in the Elasticsearch index for each property, so it's fine to send it as a string, ES will cast it. In the PC API, it appears as though it works for < and > operators, and I would think pgstac should be able to handle strings as well. I'd say open an issue on FastAPI, but leave this open for now in case there is something different that should be done client side. |
It's looking unlikely that fastapi can easily support type conversions for queries, because it seems like they'd need to explicitly define the type for any fields that would need those checks: stac-utils/stac-fastapi#202 (comment). Two thoughts/questions/ideas:
|
Numeric arguments in
--query
are passed through as strings, which breaks the query on the Planetary Computer. If this is a STAC-API implementation issue I'll close and reopen on https://github.com/stac-utils/stac-fastapi.Demonstration
Using #79 to get DEBUG output without
--save
, andjq
to return the number of matching features:Trying to query on
gsd
:The same request but direct via curl:
Using a numeric gsd in the query instead of a string:
The text was updated successfully, but these errors were encountered: