opengeospatial / ogcapi-features

An open standard for querying geospatial information on the web.
https://ogcapi.ogc.org/features
Other
341 stars 85 forks source link

Extended property selection with CQL2 expressions (like SQL SELECT) #927

Open jerstlouis opened 5 months ago

jerstlouis commented 5 months ago

Similar to how you can use SELECT in SQL not only with existing fields from a table, but also derive new fields from existing properties using expressions, we discussed defining similar capabilities for the properties= query parameter (in a separate requirement class from basic property selection).

This could be for example to convert a temperature property from Fahrenheit to Celsius, or it use multiple properties to derive the new one e.g., properties=(temp_f - 32) * 5/9.

In OGC API - Coverages, we are planning to define this capability in a Part 2, also defining Filtering and Property selection as separate requirement classes. A classic example there is computing the NDVI from multispectral imagery e.g., properties=(B08 - B04) / (B08 + B04).

Some of the things to consider:

cportele commented 5 months ago

Meeting 2024-06-03: This sounds like a reasonable and useful extension. To be decided if it would be a separate requirements class or be moved to future work. This will also depend on the number of implementations. A code sprint may be a good idea to test this.

cportele commented 5 months ago

As discussed at the OGC Member Meeting, instead of properties=(temp_f - 32) * 5/9 as temp_c we should use a separate object-valued query parameter with the deepObject style for all derived queryables and write this as properties=temp_c&alias[temp_c]=(temp_f - 32) * 5/9.