Visualizing Queries
A User-Friendly CQL2 Filter Builder for Geospatial Data
Noam Rabi, July 2025
Hi,
I’m Noam
2
Why visualize queries?
INTRO
We want to make
exploring geospatial
datasets easier.
3
Web interfaces
are good for that!
Why visualize queries?
INTRO
How to translate the form to a query?
Unfortunately, there was no
JavaScript library to help me…
�So I made one.
4
CQL2-filters-parser library
INTRO
5
CQL2 filters
What is CQL2 and why is it helpful?
STAC vs CQL2
CQL2 FILTERS
a way to organize geospatial data
a language to describe filter expressions for spatial and temporal data
7
CQL2�Common Query Language
STAC�SpatioTemporal Asset Catalog
Two encodings
CQL2 FILTERS
CQL2 comes in two encodings, �Text and JSON
8
Two encodings
CQL2 FILTERS
Differences:
9
Building blocks
CQL2 FILTERS
All of these nodes expressions in a �tree data structure.
10
Parsing Text,
Parsing JSON
Parsers
PARSING TEXT, PARSING JSON
12
Text -> tokenizer -> parser -> Expression tree
JSON -> depth first parser -> Expression tree
parse() -> Expression tree
Parsers
PARSING TEXT, PARSING JSON
13
Visitors welcome
Especially for this library :)
Visitor design pattern
VISITORS WELCOME
Separates the operation from the object.
Allows defining new operations on data structure.
15
Visitor design pattern
VISITORS WELCOME
Each node type has a corresponding visit function:
The visitor object is something that implements visit functions
16
HTML Builder Visitor
VISITORS WELCOME
The visitor object is something that implements visit functions
17
HTML Builder Visitor
VISITORS WELCOME
18
TODO
HTML Builder Visitor
VISITORS WELCOME
19
Wrapping up
CQL2-filters-parser library
WRAPPING UP
21
CQL2 Playground - https://noamra.github.io/ogc-cql2-filters
GitHub repository - https://github.com/NoamRa/ogc-cql2-filters�npm i cql2-filters-parser