pymviewer generates mviewer XML configuration files from QGIS Server
projects and WMS GetCapabilities documents.
python -m pip install -e qgisxmviewerGenerate from a QGIS project:
pymviewer from-qgs \
--project /path/to/project.qgs \
--output /path/to/config.xml \
--service-url http://localhost:90/ogc/dataGenerate from a WMS GetCapabilities file:
pymviewer from-capabilities \
--capabilities /path/to/GetCapabilities.xml \
--output /path/to/config.xml \
--service-url http://localhost:90/ogc/datafrom pathlib import Path
from pymviewer.qgisxmviewer import create_mviewer_config_from_wms_capabilities
create_mviewer_config_from_wms_capabilities(
Path("data_getcapabilities.xml"),
Path("data.xml"),
"http://localhost:90/ogc/data",
)- mviewer layer
idvalues are normalized and unique. - WMS layer names are preserved in the
layersattribute. - WMS legend URLs are encoded and can be rebased to an override service URL.
.qgsprojects are supported..qgzarchives are not supported yet.