MBStyle produces error in OGC API Styles if it contains complex functions
Description
If a mapbox gl style contains complex expressions like e.g.
this style produces an error if requested over OGC API Styles (by calling /geoserver/ogc/styles/v1/styles/test:mbteststyle/metadata?f=html )
The result is:
I can imaging that not all MBStyles can be auto-converted to SLD-styles, but it would be nice if also complex MB-styles would be delivered 1:1 .
Environment
None
Activity
Markus Heber
June 6, 2023 at 3:09 PM
And here is the style I used (a bit anonymized):
If I replace the "line-width"-Parameter with e.g. "line-width": 2, all works fine. category is a property of the layer.
Markus Heber
June 6, 2023 at 3:00 PM
Here is the stack trace, cutted at the end from geoserver
Andrea Aime
June 6, 2023 at 12:51 PM
(edited)
Do you have a full stack trace, or a mbstyle that can be used to reproduce?
In any case, I think I know what the problem is… style metadata must include the list of attributes necessary to use the style, e.g. (see “attributes used by the style”).
For that to happen, a parsing of the style with conversion to SLD is necessary, GeoServer don’t have a style specific way to extract an attribute list with required target data type, it really converts to SLD and then performs a visit on it. In other words, you need to extend the MBStyle module parsing abilities in order to use that resource.
If a mapbox gl style contains complex expressions like e.g.
this style produces an error if requested over OGC API Styles (by calling /geoserver/ogc/styles/v1/styles/test:mbteststyle/metadata?f=html )
The result is:
I can imaging that not all MBStyles can be auto-converted to SLD-styles, but it would be nice if also complex MB-styles would be delivered 1:1 .