QGISLayerDatasetExtractor
Description
This Custom Transformer parses the XML structure of QGIS project files to generate a output of all layers contained within the project including metadata regarding database connections, source paths, and WMS service names etc. It handles both uncompressed XML (.qgs) and compressed archives (.qgz), as well as projects saved internally within Geopackages (.gpkg).
Input Ports
INPUT
Accepts a single feature containing the full path to the QGIS-project file location.
Output Ports
LAYER_INFO
Outputs one feature per map layer found in the project. Each feature contains the original source attributes plus the extracted metadata.
XML
Outputs a feature containing the extracted XML content.
Returned Attributes
The following attributes are exposed on the output features:
Attribute Name
Description
layer_name
The display name of the layer as seen in the QGIS Table of Contents (Legend).
layer_id
The unique internal identifier string assigned to the layer by QGIS.
layer_enabled
Indicates if the specific layer is checked (visible) in the Table of Contents.
layer_parents_enabled
Indicates if the parent group(s) of the layer are checked (visible).
layer_group
The name of the group the layer belongs to.
layer_group_path
The full flattened path of the group hierarchy (e.g., Parent Group/Child Group).
layer_groups{}
A structured list attribute containing the hierarchy of groups the layer belongs to, including group-level WMS metadata info.
wms_layer_shortname
The short name used for WMS server publishing.
wms_layer_title
The title used for WMS server publishing.
wms_layer_abstract
The abstract/description used for WMS server publishing.
wfs_layer_title
The title used for WFS server publishing.
source_dataset_provider
The underlying provider key (e.g., ogr, postgres, spatialite, wms).
source_dataset_file_type
The specific file extension or format for file-based sources (e.g., gpkg, tif, shp).
source_dataset_db_name
The specific name of the database.
source_dataset_db_schema
The specific database schema where the table resides.
source_dataset_db_table
The name of the table or view in the database.
source_dataset_db_host
The host URL or IP address of the database server.
source_dataset_db_port
The port number used for the database connection.
source_dataset_db_user
The username associated with the database connection.
source_dataset_url
The URL for web-based sources (e.g., WMS, WFS, ArcGIS REST).
source_dataset_user
The username for services.
source_dataset_layer
Specific layer name requested from sources (e.g. a GeoPackage or WFS layers).
source_dataset_filter
Any subset string or SQL filter applied to the layer within QGIS.
datasource
The raw datasource connection string extracted from the project XML.
qgis_project_name
The name of the QGIS project file being processed.
_qgs_file_location
The full file path to the QGIS project file.
Would you like to know more? Click here to find out more details!

