The `geostyler-qgis-parser` package provides a GeoStyler Style Parser implementation specifically for QGIS (QML) styles. It enables the conversion of QGIS native styling information into the GeoStyler internal style format and vice-versa, facilitating interoperability between QGIS and other mapping libraries or services supported by GeoStyler. The current stable version is 4.1.0, released in November 2025. The project demonstrates an active release cadence with several patch and minor updates throughout 2025, indicating ongoing development and maintenance. Key differentiators include its tight integration with the GeoStyler ecosystem and its ability to handle specific QGIS style properties like `fontweight`, `fontItalic`, and `PointPat` support, as noted in recent updates. This parser is crucial for applications that need to manage or display geospatial data styled originally in QGIS.
npm install geostyler-qgis-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to instantiate the `QGISStyleParser`, read a QML string into a GeoStyler Style object, modify the style, and then write the GeoStyler Style back to a QML string.
Migrate your project to use ES modules (`import`/`export`) or use a bundler (like Webpack, Rollup, Parcel, Vite) that transpiles ESM to CommonJS if backward compatibility is strictly required. Ensure your `package.json` specifies `"type": "module"` for direct Node.js execution of ESM.
Ensure that all GeoStyler-related dependencies, especially `geostyler-style`, are updated to compatible versions. If using `geostyler-qgis-parser` v2.x, ensure `geostyler-style` is at least `^7.0.0`. For v3.x and above, refer to `geostyler-qgis-parser`'s `package.json` for the exact `geostyler-style` peer dependency.
Test conversion results thoroughly with your target QGIS version. If interoperability with older QGIS versions (pre-3.28) is critical, you might need to use an older version of `geostyler-qgis-parser` or manually adjust the output QML for compatibility, though the latter is complex.
Upgrade to `geostyler-qgis-parser` version 4.1.0 or newer to ensure full support for these QGIS style features. If upgrading is not possible, be aware that these properties will be dropped or ignored during style parsing and writing.
Update your import statement to use ES module syntax: `import { QGISStyleParser } from 'geostyler-qgis-parser';`. If running in Node.js, ensure your environment supports ESM (e.g., by setting `"type": "module"` in `package.json` or using `.mjs` file extensions).Update `geostyler-style` to the version specified as a peer dependency by your `geostyler-qgis-parser` version. Also, ensure any GeoStyler style objects passed to the parser are generated by compatible GeoStyler components or parsers.