Small helper scripts for converting .lyrx files to .sld, fixing known GeoServer-specific issues, and validating the generated styles.
lyrx_to_sld.sh— full conversion pipelinefix_sld_vendoroptions.sh— fixes knownVendorOptionordering issuesgeoserver_validate.sh— validates SLD files against GeoServer REST: Used by system. You need geoserver to run this.xmllint_validate.sh— validates SLD files against the OGC schemaqgis_sld_test.py— quick SLD test script for QGIS Python Console : Copy the code into QGIS Python console and test your SLD
Run the full conversion pipeline with an absolute folder path:
./lyrx_to_sld.sh /full/path/to/folderWhat it does:
- starts a temporary
lyrx2sldcontainer - converts all
.lyrxfiles in the target folder - extracts real
.sldfiles from the returned ZIP payloads - validates the results with GeoServer
- applies the SLD fix only if validation fails
- removes temporary containers when finished
- The
data/folder is ignored and treated as local working data. xmllintmay reportVendorOptionwarnings for GeoServer-specific styles.- GeoServer validation is the main acceptance check for this project.