-
Notifications
You must be signed in to change notification settings - Fork 3
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
Expression discussion #26
Comments
To avoid possible misunderstandings about the capabilities of the expression engine, it may be a good idea to specify the type of expression. <Width>sql(st_area( the_geom )/10000)</Width>
<Width>ecql(area( the_geom )/10000)</Width> |
In SE spec so we can imagine |
Following the concept of Tranform element exposed in the VEGA-LITE specification (https://vega.github.io/vega-lite/docs/transform.html) we can offer a simple way to define if the style model must used a SQL or a CQL-TEXT (http://docs.opengeospatial.org/DRAFTS/19-079.html) mechanism. Expose SQL {
"Feature2DStyle": {
"Name": "Unnamed Style",
"Rule": {
"Name": "Default Rule",
"Transform": {
"SQL": {
"Filter": "where id >12"
}
},
"PointSymbolizer": {
"Name": "Point symbolizer",
"Uom": "PX",
"Geometry": "the_geom",
"Level": 0,
"MarkGraphic": {
"WellKnownName": "circle",
"Size": 10,
"PenStroke": {
"SolidFill": {
"Color": "#000000",
"Opacity": 1
},
"Width": 0.25,
"LineCap": "BUTT",
"LineJoin": "MITRE"
},
"SolidFill": {
"Color": "#000000",
"Opacity": 1
}
}
}
}
}
} Expose CQL-TEXT {
"Feature2DStyle": {
"Name": "Unnamed Style",
"Rule": {
"Name": "Default Rule",
"Transform": {
"CQL-text": {
"Filter": "id >12"
}
},
"PointSymbolizer": {
"Name": "Point symbolizer",
"Uom": "PX",
"Geometry": "the_geom",
"Level": 0,
"MarkGraphic": {
"WellKnownName": "circle",
"Size": 10,
"PenStroke": {
"SolidFill": {
"Color": "#000000",
"Opacity": 1
},
"Width": 0.25,
"LineCap": "BUTT",
"LineJoin": "MITRE"
},
"SolidFill": {
"Color": "#000000",
"Opacity": 1
}
}
}
}
}
} |
Because CQL-TEXT is only dedicated to filter we can removed the Filter field and write "Transform": {
"CQL-text": "id >12"
}, |
All ParameterValue that permit to custom symbol elements in Feature2DTypeStyle support expression.
See examples
We use the term expression to set when the ParameterValue is an Expression.
Currently there is no specification at OGC to define in a human way (as SQL does) an expression.
The most important work has been done by the geotools community with the ECQL (Extended Common Query Language).
See https://github.com/geotools/geotools/tree/master/modules/library/cql
With next OGC API - Features - Part 3: Common Query Language (http://docs.opengeospatial.org/DRAFTS/19-079.html#simple-cql_filter-expression) proposes to formalize the definition of an expression and shows possible encoding with json (https://github.com/tschaub/ogcapi-features/tree/json-array-expression/extensions/cql/jfe).
At the OrbisMap side an expression is currently a fragment of a SQL query. So in a style, when you have
the data background system runs
or
the data background system runs
Using SQL as the expression provider has several advantages :
and cons
This means that it is possible not to have the same functions from one datasource to another (e.g POSTGIS vs H2GIS vs SpatialLite).
The text was updated successfully, but these errors were encountered: