Skip to main content
100%

POC pour rechercher remplacer des URLS dans un projet QGIS

✓ Published0🌍 Public
TThomasG77
Last edited Oct 11, 2022
Created on Oct 11, 2022

This example shows a Python script that migrates QGIS project files by replacing old French geoportal URLs with new ones in both .qgs and .qgz formats. It first searches and replaces URL pairs directly in .qgs text, and for .qgz archives, it unpacks the zip, applies the same replacement to embedded .qgs files, then repacks the archive. The tool uses standard library modules `argparse`, `tempfile`, `shutil`, and `pathlib` to handle file operations and globbing, while string replacement is done with `str.replace()`.

AI-generated description

Similar vizzes