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

update spatial function changes in CQL2 #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - TBD

### Changed

- Added Basic Spatial Functions with additional Spatial Data Types definition, which defines
a class that has only S_INTERSECTS over all geometry data types
- Renamed Basic Spatial Operators to Basic Spatial Functions
- Renamed Spatial Operators to Spatial Functions
- Renamed Temporal Operators to Temporal Functions
- Renamed Array Operators to Array Functions

## [v1.0.0-rc.3] - 2023-10-18

### Added
Expand Down
68 changes: 39 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
- [Example 6: Temporal Intersection](#example-6-temporal-intersection)
- [Example 6: T\_INTERSECTS cql2-text (GET)](#example-6-t_intersects-cql2-text-get)
- [Example 6: T\_INTERSECTS cql2-json (POST)](#example-6-t_intersects-cql2-json-post)
- [Example 7: Spatial Intersection in Basic Spatial Operators](#example-7-spatial-intersection-in-basic-spatial-operators)
- [Example 7: Spatial Intersection in Basic Spatial Functions](#example-7-spatial-intersection-in-basic-spatial-functions)
- [Example 7: S\_INTERSECTS cql2-text (GET)](#example-7-s_intersects-cql2-text-get)
- [Example 7: S\_INTERSECTS cql2-json (POST)](#example-7-s_intersects-cql2-json-post)
- [Example 8: Spatial Intersection in Spatial Operators](#example-8-spatial-intersection-in-spatial-operators)
- [Example 8: Spatial Intersection](#example-8-spatial-intersection)
- [Example 8: S\_INTERSECTS cql2-text (GET)](#example-8-s_intersects-cql2-text-get)
- [Example 8: S\_INTERSECTS cql2-json (POST)](#example-8-s_intersects-cql2-json-post)
- [Example 9: Spatial Intersection Disjunction](#example-9-spatial-intersection-disjunction)
Expand All @@ -52,6 +52,9 @@
- [Example 14: Using the ACCENTI Accent-insensitive Comparison Function](#example-14-using-the-accenti-accent-insensitive-comparison-function)
- [Example 14: cql2-text (GET)](#example-14-cql2-text-get)
- [Example 14: cql2-json (POST)](#example-14-cql2-json-post)
- [Example 15: Using the IN List predicate](#example-15-using-the-in-list-predicate)
- [Example 15: cql2-text (GET)](#example-15-cql2-text-get)
- [Example 15: cql2-json (POST)](#example-15-cql2-json-post)

## Overview

Expand All @@ -65,12 +68,13 @@
- CQL2 JSON: `http://www.opengis.net/spec/cql2/1.0/conf/cql2-json`
- Basic CQL2: `http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2`
- Advanced Comparison Operators: `http://www.opengis.net/spec/cql2/1.0/conf/advanced-comparison-operators`
- Basic Spatial Operators: `http://www.opengis.net/spec/cql2/1.0/conf/basic-spatial-operators`
- Spatial Operators: `http://www.opengis.net/spec/cql2/1.0/conf/spatial-operators`
- Temporal Operators: `http://www.opengis.net/spec/cql2/1.0/conf/temporal-operators`
- Basic Spatial Functions: `http://www.opengis.net/spec/cql2/1.0/conf/basic-spatial-functions`
- Basic Spatial Functions with additional Spatial Data Types: `http://www.opengis.net/spec/cql2/1.0/conf/basic-spatial-functions-plus`
- Spatial Functions: `http://www.opengis.net/spec/cql2/1.0/conf/spatial-functions`
- Temporal Functions: `http://www.opengis.net/spec/cql2/1.0/conf/temporal-functions`
- Custom Functions: `http://www.opengis.net/spec/cql2/1.0/conf/functions`
- Arithmetic Expressions: `http://www.opengis.net/spec/cql2/1.0/conf/arithmetic`
- Array Operators: `http://www.opengis.net/spec/cql2/1.0/conf/array-operators`
- Array Functions: `http://www.opengis.net/spec/cql2/1.0/conf/array-functions`
- Property-Property Comparisons: `http://www.opengis.net/spec/cql2/1.0/conf/property-property`
- Accent and Case-insensitive Comparison: `http://www.opengis.net/spec/cql2/1.0/conf/accent-case-insensitive-comparison`
- **Scope:** STAC API - Features, STAC API - Item Search
Expand Down Expand Up @@ -147,10 +151,11 @@ CQL2 enables more expressive queries than supported by STAC API Item Search. The

OAFeat Part 3 CQL2 defines several conformance classes that allow implementers to create compositions of
functionality that support whatever expressiveness they need. This allows implementers to incrementally support CQL
syntax, without needing to implement a huge spec all at once. Some implementers choose not to incur the cost of
syntax, without needing to implement a large specification all at once. Some implementers choose not to incur the cost of
implementing functionality they do not need or may not be able to implement functionality that is not supported by
their underlying datastore, e.g., Elasticsearch does not support the spatial predicates required by the
Spatial Operators conformance class, only the `S_INTERSECTS` operator in the Basic Spatial Operators class.
Spatial Functions conformance class, only the `S_INTERSECTS` function against geometries in the
Basic Spatial Functions with additional Spatial Data Types class.

The STAC API Filter Extension reuses the definitions and conformance classes in OAFeat CQL,
adding only the *Item Search Filter* conformance class
Expand Down Expand Up @@ -190,26 +195,31 @@ For additional capabilities, the following classes may be implemented:
(`http://www.opengis.net/spec/cql2/1.0/conf/advanced-comparison-operators`) defines the `LIKE`,
`BETWEEN`, and `IN` operators. **Note**: this conformance class no longer requires implementing the
`lower` and `upper` functions.
- Basic Spatial Operators (`http://www.opengis.net/spec/cql2/1.0/conf/basic-spatial-operators`) defines the intersects operator (`S_INTERSECTS`)
that accepts only a BBOX or POINT parameter.
- Spatial Operators
(`http://www.opengis.net/spec/cql2/1.0/conf/spatial-operators`) defines a set of operators that
are part of the Dimensionally Extended Nine-intersection Model (DE-9IM) relation operators
(`S_CONTAINS`, `S_CROSSES`, `S_DISJOINT`, `S_EQUALS`, `S_INTERSECTS`, `S_OVERLAPS`, `S_TOUCHES`, and `S_WITHIN`),
and additionally defines the intersects operator (`S_INTERSECTS`) to accept LINESTRING,
POLYGON, MULTIPOINT, MULTILINESTRING, and MULTIPOLYGON,
in addition to BBOX and POINT as supported in Basic Spatial Operators.
- Temporal Operators
(`http://www.opengis.net/spec/cql2/1.0/conf/temporal-operators`) defines several temporal
operators that provide more expressivity with datetime types than the relative comparison
- Basic Spatial Functions (`http://www.opengis.net/spec/cql2/1.0/conf/basic-spatial-functions`) defines the intersects function (`S_INTERSECTS`)
that accepts only a BBOX or Point parameter.
- Basic Spatial Functions with additional Spatial Data Types
(`http://www.opengis.net/spec/cql2/1.0/conf/basic-spatial-functions-plus`) defines the
intersects function (`S_INTERSECTS`)
to accept any geometry data type, including Point, MultiPoint, LineString, MultiLineString,
Polygon, MultiPolygon, or GeometryCollection, in addition to BBOX and POINT as supported in
Basic Spatial Functions.
- Spatial Functions
(`http://www.opengis.net/spec/cql2/1.0/conf/spatial-functions`) defines a set of functions that
are part of the Dimensionally Extended Nine-intersection Model (DE-9IM) relation functions
(`S_CONTAINS`, `S_CROSSES`, `S_DISJOINT`, `S_EQUALS`, `S_INTERSECTS`, `S_OVERLAPS`,
`S_TOUCHES`, and `S_WITHIN`) over both BBOX and geometry data types Point, MultiPoint,
LineString, MultiLineString, Polygon, MultiPolygon, or GeometryCollection.
- Temporal Functions
(`http://www.opengis.net/spec/cql2/1.0/conf/temporal-functions`) defines several temporal
functions that provide more expressivity with datetime types than the relative comparison
operators
in the Basic CQL2 class.
- Custom Functions (`http://www.opengis.net/spec/cql2/1.0/conf/functions`) defines support
for function definition and usage.
- Arithmetic Expressions: (`http://www.opengis.net/spec/cql2/1.0/conf/arithmetic`) defines
support for arithmetic expressions.
- Array Operators: (`http://www.opengis.net/spec/cql2/1.0/conf/array-operators`)
defines array operators (`A_EQUALS`, `A_CONTAINS`, `A_CONTAINED_BY`, and `A_OVERLAPS`).
- Array Functions: (`http://www.opengis.net/spec/cql2/1.0/conf/array-functions`)
defines array functions (`A_EQUALS`, `A_CONTAINS`, `A_CONTAINED_BY`, and `A_OVERLAPS`).
- Property-Property Comparisons: (`http://www.opengis.net/spec/cql2/1.0/conf/property-property`)
allows the use of queryables (e.g., properties) in both positions of a clause, not just in the
first position. This allows predicates like `property1 = property2` be expressed, whereas the
Expand Down Expand Up @@ -404,9 +414,8 @@ at least these values:
"http://www.opengis.net/spec/cql2/1.0/conf/cql2-text",
"http://www.opengis.net/spec/cql2/1.0/conf/cql2-json",
"http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2",
"http://www.opengis.net/spec/cql2/1.0/conf/basic-spatial-operators",
"http://www.opengis.net/spec/cql2/1.0/conf/basic-spatial-functions",
"http://www.opengis.net/spec/cql2/1.0/conf/advanced-comparison-operators"

],
"links": [
{
Expand Down Expand Up @@ -810,7 +819,7 @@ filter=prop1 = prop2

This uses the same queryables as Example 3.

The only temporal operator required is `T_INTERSECTS`. This is effectively that the datetime or interval operands
The only temporal function required is `T_INTERSECTS`. This is effectively that the datetime or interval operands
have any overlap between them.

#### Example 6: T_INTERSECTS cql2-text (GET)
Expand All @@ -834,9 +843,9 @@ filter=T_INTERSECTS(datetime, INTERVAL('2020-11-11T00:00:00Z', '2020-11-12T00:00
}
```

### Example 7: Spatial Intersection in Basic Spatial Operators
### Example 7: Spatial Intersection in Basic Spatial Functions

The only spatial operator that must be implemented for Basic Spatial Operators
The only spatial function that must be implemented for Basic Spatial Functions
is `S_INTERSECTS` supporting BBOX and POINT. This has the same semantics as provided
by the Item Search `intersects` parameter. The `cql2-text` format uses WKT geometries and the `cql2-json`
format uses GeoJSON geometries.
Expand Down Expand Up @@ -865,9 +874,10 @@ filter=S_INTERSECTS(geometry,POINT(-77.0824 38.7886))
}
```

### Example 8: Spatial Intersection in Spatial Operators
### Example 8: Spatial Intersection

The Spatial Operators extends the Basic Spatial Operators by adding support for additional
The Basic Spatial Functions with additional Spatial Data Types class extends
the Basic Spatial Functions class by adding support for additional
geometries to the `S_INTERSECTS` parameter. This has the same semantics as provided
by the Item Search `intersects` parameter. The `cql2-text` format uses WKT geometries and the `cql2-json`
format uses GeoJSON geometries.
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@redocly/openapi-cli": "^1.0.0-beta.94",
"@stoplight/spectral-cli": "^6.11.0",
"gh-pages": "^6.0.0",
"gh-pages": "^6.1.1",
"redoc-cli": "^0.13.21",
"remark-cli": "^12.0.0",
"remark-lint": "^9.1.2",
Expand Down