Skip to main content

bridge-style

License: MIT CLA assistant

bridgestyle is a Python library that allows you to convert cartographic symbology formats.
It uses GeoStyler (JSON) as an intermediate format, and follows a two-step approach:

  1. Convert from the supported original format into the GeoStyler format.
  2. Convert from GeoStyler into a supported destination format.

Supported formats

In the table below you'll find the symbology formats that can be converted from one to another. The first column shows the source formats, and the first row shows the destination formats:

QGIS (QML) ArcGIS Pro (CIM) GeoStyler SLD (GeoServer) MapLibre GL JS Mapfile (MapServer)
QGIS (QML) n/a
ArcGIS Pro (CIM) n/a
GeoStyler n/a
SLD (GeoServer) n/a
MapLibre GL JS n/a
Mapfile (MapServer) n/a

As you can see, the current main goal of this library is:

  • to convert QGIS symbology via GeoStyler into all other formats
    OR
  • to convert ArcGIS Pro .lyrx files via GeoStyler into all other formats except QGIS.

⚠️ WARNING ⚠️
Converting from QGIS symbology (QML) into something else requires the QGIS Python API. In that case, you can only use this library in a QGIS runtime environment.

ArcGIS Pro users can create a Python toolbox that utilizes bridgestyle either directly (requires installation so you can import it) or by calling style2style using subprocess for example.

Limitations

Because symbology formats are very different and the software they are intended for have different capabilities, not all symbology features can be converted between formats.

To find out what the exact limitations are, you will have to check the code... 😥

However, there is a document for QGIS that lists the QGIS symbology features that are (not) supported by the GeoStyler format. For more elaborate information, you can consult the GeoCat Bridge for QGIS documentation.

If you wish to convert ArcGIS Pro .lyrx files into SLD, you may want to read this document. There are also some notes on MapServer.

Installation

Since June 2025, bridgestyle is available on PyPI, which means you can install it using pip. In your active Python environment, run the following command:

pip install bridgestyle

However, if you wish to use the library in QGIS, we highly recommend installing the GeoCat Bridge for QGIS plugin instead, as it already includes bridgestyle and provides a style preview and other useful features.
The plugin is available in the QGIS plugin repository, and can be installed directly from the QGIS Plugin Manager.

Usage

Here is an example how to export the symbology of a selected QGIS layer into a zip file containing an SLD style file and all the icons files (SVG, PNG, etc.) used by the layer:

from bridgestyle.qgis import saveLayerStyleAsZippedSld
warnings = saveLayerStyleAsZippedSld(iface.activeLayer(), "/my/path/mystyle.zip")

The warnings variable will contain a list of strings with the issues found during the conversion.

Conversion can be performed outside QGIS, using the library as a standalone element. Each format has its own Python package, which contains two modules: togeostyler and fromgeostyler, each of them with a convert method to do the conversion work. It returns the converted style as a string, and a list of strings with issues found during the conversion (such as unsupported symbology elements that could not be correctly converted).

Here is an example how to convert a GeoStyler JSON file into an SLD file:

from bridgestyle import sld
input_file = "/my/path/input.geostyler"
output_file = "/my/path/output.sld"

# We load the GeoStyler code from the input file
with open(input_file) as f:
    geostyler = json.load(f)

'''
We pass it to the fromgeostyler.convert method from the sld package.
There is one such module and function for each supported format, which 
takes a Python object representing the GeoStyler JSON object and returns 
a string with the style in the destination format.
'''
converted, warnings, obj = sld.fromgeostyler.convert(geostyler)

# We save the resulting string in the destination file
with open(output_file) as f:
    f.write(f)

style2style

A basic command line tool (CLI) is also available. When the library is installed in your Python environment, you will have a style2style script available to be run in your console, with the following syntax:

style2style original_style_file.ext destination_style_file.ext

The file format is inferred from the file extension.

The example conversion shown above would be run with the console tool as follows:

style2style /my/path/input.geostyler /my/path/output.sld

Contributing

If you would like to contribute to bridgestyle in any way, please read the contributing guidelines.

Some of the things you can do to help are:

  • Fix bugs and issues
  • Add new features (e.g. support for new formats, or add bidirectional conversion)
  • Improve documentation
  • Add tests

Release files for bridgestyle 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bridgestyle 0.1.9
File Size Uploaded
bridgestyle-0.1.9.tar.gz 188.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bridgestyle 0.1.9
File Interpreter ABI Platform
bridgestyle-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 237.4 kB

Release files / bridgestyle-0.1.9.tar.gz

Download URL bridgestyle-0.1.9.tar.gz
Size 188.1 kB
Tags Source
SHA-256 checksum
How to use checksums
02e6163861b87329c389c654631291df076bf6c739b09d8a81e41c268ab9b5e0
BLAKE2b-256 checksum
How to use checksums
f188ea44d89a349c80c6d3648b81a54096b242cebe45168a26bf6fc0b53cc661
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 22, 2026.

Transparency log

Release files / bridgestyle-0.1.9-py3-none-any.whl

Download URL bridgestyle-0.1.9-py3-none-any.whl
Size 49.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86bcee64077ec669a0ddca7b66d98c302d893f049dddb40e07bd8b826f05e348
BLAKE2b-256 checksum
How to use checksums
49af3419d3995dcc55441464623d65a0edff06931dce1536c072e8b9dcd1c212
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page