You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prepare a grammar language for writing custom SQL filters (simplest option for users - utilize replacement, simplest option to implement - allow users to use DuckDB functions and expect them to use it)
Examples:
-- Queries provided by user-- Option 1: probably simplest for the end user, will require additional step to unnest all key value pairs
(osm_tag_key ='highway'AND (osm_tag_value LIKE'%ary'OR osm_tag_value ='motorway'))
-- Expanded in the QuackOSM query
WITH raw_data AS (
SELECT kind, id, tags
FROM ST_ReadOSM('tests/test_files/monaco.osm.pbf')
WHERE tags IS NOT NULL
),
unnested_data AS (
SELECT kind, id, UNNEST(map_entries(tags)) kv_pair
FROM raw_data
),
expanded_data AS (
SELECT kind, id, kv_pair['key'] as osm_tag_key, kv_pair['value'] as osm_tag_value
FROM unnested_data
),
filtered_elements AS (
SELECT DISTINCT kind, id
FROM expanded_data
-- paste filter here 1 to 1WHERE (osm_tag_key ='highway'AND (osm_tag_value LIKE'%ary'OR osm_tag_value ='motorway'))
)
SELECT*FROM raw_data
SEMI JOIN filtered_elements USING (kind, id)
The text was updated successfully, but these errors were encountered:
Prepare a grammar language for writing custom SQL filters (simplest option for users - utilize replacement, simplest option to implement - allow users to use DuckDB functions and expect them to use it)
Examples:
The text was updated successfully, but these errors were encountered: