/qgs_parser

Parse Qgis 2 project and create JSON config file. Archived, see version for Qgis 3 at https://github.com/geraldo/qgs-layer-parser/

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

qgs_parser

Parse QGIS project file and create JSON config file

Start the script using ./parse.sh [file.qgs], for example, ./parse.sh poum.qgs

Creates a JSON configuration file called [file.qgs.json] in the same directory.

A typical output for a layer could look like that:

  {
    "visible": true,
    "fields": [],
    "mapproxy": "ctbb_poum_layer__tm_limit_pol",
    "indentifiable": false,
    "name": "@ tm_limit_pol",
    "actions": [],
    "hidden": true,
    "type": "layer",
    "showlegend": true
  },

Special characters used as layer/group names in QGIS:

  • @ sets "hidden": true: Don't show layer/group in layerswitcher (but layer/groups are by default rendered).
  • ~ sets "showlegend": false: Don't show legend for layer/group.