Skip to content

Commit 3419101

Browse files
authored
Enable querying of the geometry column even when strict mode is activated (#240)
1 parent e0b7de4 commit 3419101

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/pgstac/sql/002b_cql.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ BEGIN
273273
FOR prop IN
274274
SELECT DISTINCT p->>0
275275
FROM jsonb_path_query(j, 'strict $.**.property') p
276-
WHERE p->>0 NOT IN ('id', 'datetime', 'end_datetime', 'collection')
276+
WHERE p->>0 NOT IN ('id', 'datetime', 'geometry', 'end_datetime', 'collection')
277277
LOOP
278278
IF (queryable(prop)).nulled_wrapper IS NULL THEN
279279
RAISE EXCEPTION 'Term % is not found in queryables.', prop;

src/pgstac/tests/pgtap/002a_queryables.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ SELECT lives_ok(
9797
'Make sure a term present in the list of queryables can be used in a filter'
9898
);
9999

100+
SELECT lives_ok(
101+
$$ SELECT search('{"filter": {"s_intersects": [{"property": "geometry"}, {"type": "Point", "coordinates": [0, 0]}]}}'); $$,
102+
'Make sure a term present in the list of queryables can be used in a filter'
103+
)
104+
100105
SELECT lives_ok(
101106
$$ SELECT search('{"filter": {"and": [{"t_after": [{"property": "datetime"}, "2020-11-11T00:00:00"]}, {"t_before": [{"property": "datetime"}, "2022-11-11T00:00:00"]}]}}'); $$,
102107
'Make sure that only arguments that are properties are checked'

0 commit comments

Comments
 (0)