-
Notifications
You must be signed in to change notification settings - Fork 48
Add load_queryables function to pypgstac
#361
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
Conversation
…date documentation and examples
… adjust example and tests accordingly
…delete_missing option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per my comment above, I think that we should not create an index for every possible queryable. That is likely to degrade performance more than it would help. Indexes should only be created on the most used or most selective queryables. I think adding a index_fields argument that allows for giving a list of fields which indexes should be created for (Or possibly a second command just for setting indexing???)
Description
This PR adds a new
load_queryablesfunction to pypgstac that allows loading queryables from a JSON file. Queryables are a mechanism that allows clients to discover what terms are available for use when writing filter expressions in a STAC API.The new function:
Changes
load_queryablesmethod to thePgstacCLIclass insrc/pypgstac/src/pypgstac/pypgstac.pydocs/src/pypgstac.mdto include information about the new commandsrc/pypgstac/examples/sample_queryables.json: A sample queryables definition filesrc/pypgstac/examples/load_queryables_example.py: An example script showing how to use the function programmaticallysrc/pypgstac/tests/test_queryables.pyUsage
The new command can be used as follows:
Or programmatically:
Testing
The implementation has been tested with various scenarios:
All tests pass successfully.