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

Enable querying of the geometry column #240

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pgstac/sql/002b_cql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ BEGIN
FOR prop IN
SELECT DISTINCT p->>0
FROM jsonb_path_query(j, 'strict $.**.property') p
WHERE p->>0 NOT IN ('id', 'datetime', 'end_datetime', 'collection')
WHERE p->>0 NOT IN ('id', 'datetime', 'geometry', 'end_datetime', 'collection')
LOOP
IF (queryable(prop)).nulled_wrapper IS NULL THEN
RAISE EXCEPTION 'Term % is not found in queryables.', prop;
Expand Down
5 changes: 5 additions & 0 deletions src/pgstac/tests/pgtap/002a_queryables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ SELECT lives_ok(
'Make sure a term present in the list of queryables can be used in a filter'
);

SELECT lives_ok(
$$ SELECT search('{"filter": {"s_intersects": [{"property": "geometry"}, {"type": "Point", "coordinates": [0, 0]}]}}'); $$,
'Make sure a term present in the list of queryables can be used in a filter'
)

SELECT lives_ok(
$$ SELECT search('{"filter": {"and": [{"t_after": [{"property": "datetime"}, "2020-11-11T00:00:00"]}, {"t_before": [{"property": "datetime"}, "2022-11-11T00:00:00"]}]}}'); $$,
'Make sure that only arguments that are properties are checked'
Expand Down
Loading