Open jmacura opened 1 year ago
Hi, thanks for the report. Currently the qgisparser supports very simple styles like https://github.com/geostyler/geostyler-qgis-parser/blob/master/data/qmls/polygon_simple.qml
As the symbolization features in QGis are almost endless i'm not sure what could have change. But as the post style is still "renderer-v2" i would assume that it should work. If not the error message should be more speaking. I'll check your qgis files and add more feedback if possible.
I have a qgis 3.22.4 runnig on my system. If i import and export and your style it looks different and can be parsed with the geostyler-qgis-parser in the demo: ping.qml.zip
Unfortunately i wont have time to debug into this deeper nor to fix it. It would be great if you could find some time to dig deeper here.
I can confirm that the error exists. It probably stems from the fact, that the new XML-Structure is as follows (Root <Option>
tag with <Option />
children.
<layer>
<Option>
<!-- multiple nested Options -->
<Option />
</Option>
</layer>
Used to be direct prop
children to <layer>
:
<layer>
<prop />
</layer>
This is why the following function fails, as there are no props.
/**
*
* @param qmlSymbolizer
*/
qmlSymbolizerLayerPropsToObject(qmlSymbolizer: any) {
const qmlMarkerProps: any = {};
qmlSymbolizer.prop.forEach((prop: QmlProp) => {
const key = prop.$.k;
const value = prop.$.v;
qmlMarkerProps[key] = value;
});
return qmlMarkerProps;
}
I'd be happy to look into it, but probably would need a short introduction from one member of the core-Team on how parsers are implemented and how the dev setup works.
I added a screenshot for illustration:
I have created a work in progress. I converted all of the styles through a 3.28 Firenze QGIS to the new schema. The Parser correctly reads <Option>
instead of <prop>
and also writes correctly. It needs to
register under the root <Option type="Map">
The write tests fail, probably the testing files should be stripped by all
non necessary tags. The branch is in my fork: https://github.com/OSHistory/geostyler-qgis-parser/tree/readQGIS228
Question
Hello, I am failing to parse any QML file created in QGIS 3.28. Looking in the code, there seem to be a significantly different inner structure of the
<symbol>
element. I am attaching a short example below. It should be a rough equivalent to https://github.com/geostyler/geostyler-qgis-parser/blob/master/data/qmls/polygon_simple.qml – a fill symbol with color, outline color and outline width.super-ugly-zones_only-symbology.zip
Parsing this QML with geostyler-qgis-parser leaves me with a following error (trimmed):![image](https://user-images.githubusercontent.com/5598693/223873964-ed79f3c2-8706-417e-9919-cecd162f36b1.png)
Related issue in hslayers: https://github.com/hslayers/hslayers-ng/issues/3513
Could you please confirm that the issue is relevant? Is there a change in the way QGIS is exporting QML files which is not yet reflected in geostyler? I went through the QGIS visual changelogs but I have found no mention about any change in this regard (until version 3.30 which is not yet relevant as I am using 3.28)... Thanks!