@vectoriahq/quac 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +35 -2
- package/dist/generate/arcgisStacCatalogue.d.ts +46 -0
- package/dist/generate/arcgisStacCatalogue.js +189 -0
- package/dist/generate/externalStacCatalogue.d.ts +53 -0
- package/dist/generate/externalStacCatalogue.js +145 -0
- package/dist/generate/fileLayerCollection.d.ts +44 -0
- package/dist/generate/fileLayerCollection.js +72 -0
- package/dist/generate/folderStacCatalogue.d.ts +48 -0
- package/dist/generate/folderStacCatalogue.js +69 -0
- package/dist/generate/normalizedProject.d.ts +451 -0
- package/dist/generate/normalizedProject.js +925 -0
- package/dist/generate/ogcFeaturesStacCatalogue.d.ts +49 -0
- package/dist/generate/ogcFeaturesStacCatalogue.js +207 -0
- package/dist/generate/qmlForLayer.d.ts +17 -0
- package/dist/generate/qmlForLayer.js +36 -0
- package/dist/generate/serverLayerTree.d.ts +44 -0
- package/dist/generate/serverLayerTree.js +50 -0
- package/dist/generate/serverStacCatalogue.d.ts +84 -0
- package/dist/generate/serverStacCatalogue.js +327 -0
- package/dist/generate/stacCatalogue.d.ts +110 -0
- package/dist/generate/stacCatalogue.js +882 -0
- package/dist/generate/wfsStacCatalogue.d.ts +37 -0
- package/dist/generate/wfsStacCatalogue.js +127 -0
- package/dist/generate/wmsStacCatalogue.d.ts +46 -0
- package/dist/generate/wmsStacCatalogue.js +228 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.js +52 -0
- package/dist/model/QgsProject.d.ts +722 -0
- package/dist/model/QgsProject.js +15 -0
- package/dist/model/Stac.d.ts +320 -0
- package/dist/model/Stac.js +16 -0
- package/dist/model/WmsProject.d.ts +105 -0
- package/dist/model/WmsProject.js +1 -0
- package/dist/model/arcgis.d.ts +134 -0
- package/dist/model/arcgis.js +1 -0
- package/dist/model/delimitedText.d.ts +38 -0
- package/dist/model/delimitedText.js +46 -0
- package/dist/model/featureFilter.d.ts +41 -0
- package/dist/model/featureFilter.js +24 -0
- package/dist/model/fieldIconAddress.d.ts +27 -0
- package/dist/model/fieldIconAddress.js +93 -0
- package/dist/model/ogcFeatures.d.ts +40 -0
- package/dist/model/ogcFeatures.js +6 -0
- package/dist/model/quacExtension.d.ts +28 -0
- package/dist/model/quacExtension.js +75 -0
- package/dist/model/stacAssetRoles.d.ts +33 -0
- package/dist/model/stacAssetRoles.js +44 -0
- package/dist/model/stacCollectionNotes.d.ts +21 -0
- package/dist/model/stacCollectionNotes.js +44 -0
- package/dist/model/stacHref.d.ts +56 -0
- package/dist/model/stacHref.js +93 -0
- package/dist/model/stacPmtiles.d.ts +38 -0
- package/dist/model/stacPmtiles.js +69 -0
- package/dist/model/stacSizeAndCount.d.ts +14 -0
- package/dist/model/stacSizeAndCount.js +20 -0
- package/dist/model/stacStyles.d.ts +93 -0
- package/dist/model/stacStyles.js +87 -0
- package/dist/model/stacTreeWalk.d.ts +36 -0
- package/dist/model/stacTreeWalk.js +76 -0
- package/dist/model/stacWms.d.ts +18 -0
- package/dist/model/stacWms.js +73 -0
- package/dist/model/stacWmts.d.ts +34 -0
- package/dist/model/stacWmts.js +90 -0
- package/dist/model/stacXyz.d.ts +24 -0
- package/dist/model/stacXyz.js +46 -0
- package/dist/model/wfs.d.ts +136 -0
- package/dist/model/wfs.js +1 -0
- package/dist/parse/collectLayerVisibility.d.ts +10 -0
- package/dist/parse/collectLayerVisibility.js +22 -0
- package/dist/parse/customProperties.d.ts +18 -0
- package/dist/parse/customProperties.js +43 -0
- package/dist/parse/geometrySiblings.d.ts +25 -0
- package/dist/parse/geometrySiblings.js +83 -0
- package/dist/parse/parseBrandColour.d.ts +14 -0
- package/dist/parse/parseBrandColour.js +25 -0
- package/dist/parse/parseDataDefinedEditable.d.ts +38 -0
- package/dist/parse/parseDataDefinedEditable.js +76 -0
- package/dist/parse/parseDataSource.d.ts +53 -0
- package/dist/parse/parseDataSource.js +484 -0
- package/dist/parse/parseExtent.d.ts +17 -0
- package/dist/parse/parseExtent.js +49 -0
- package/dist/parse/parseFormLayout.d.ts +26 -0
- package/dist/parse/parseFormLayout.js +60 -0
- package/dist/parse/parseGetProjectSettings.d.ts +15 -0
- package/dist/parse/parseGetProjectSettings.js +172 -0
- package/dist/parse/parseLayers.d.ts +23 -0
- package/dist/parse/parseLayers.js +1122 -0
- package/dist/parse/parseLegendTree.d.ts +20 -0
- package/dist/parse/parseLegendTree.js +66 -0
- package/dist/parse/parseMeasurement.d.ts +21 -0
- package/dist/parse/parseMeasurement.js +67 -0
- package/dist/parse/parseMergin.d.ts +19 -0
- package/dist/parse/parseMergin.js +51 -0
- package/dist/parse/parseProjectVariables.d.ts +9 -0
- package/dist/parse/parseProjectVariables.js +19 -0
- package/dist/parse/parseQfieldSync.d.ts +47 -0
- package/dist/parse/parseQfieldSync.js +95 -0
- package/dist/parse/parseQgsXml.d.ts +15 -0
- package/dist/parse/parseQgsXml.js +100 -0
- package/dist/parse/parseRelations.d.ts +19 -0
- package/dist/parse/parseRelations.js +64 -0
- package/dist/parse/parseStyle.d.ts +33 -0
- package/dist/parse/parseStyle.js +128 -0
- package/dist/parse/parseWmsPublishing.d.ts +21 -0
- package/dist/parse/parseWmsPublishing.js +38 -0
- package/dist/parse/projectProperties.d.ts +15 -0
- package/dist/parse/projectProperties.js +27 -0
- package/dist/parse/qgisExpression.d.ts +194 -0
- package/dist/parse/qgisExpression.js +859 -0
- package/dist/parse/qtDateFormat.d.ts +74 -0
- package/dist/parse/qtDateFormat.js +324 -0
- package/dist/parse/qtRegex.d.ts +67 -0
- package/dist/parse/qtRegex.js +397 -0
- package/dist/parse/readProjectFile.d.ts +7 -0
- package/dist/parse/readProjectFile.js +27 -0
- package/dist/sources/qgisServerUrl.d.ts +6 -0
- package/dist/sources/qgisServerUrl.js +17 -0
- package/dist/sources/stacDocuments.d.ts +40 -0
- package/dist/sources/stacDocuments.js +85 -0
- package/dist/sources/stacItems.d.ts +109 -0
- package/dist/sources/stacItems.js +287 -0
- package/dist/util/catalogueFileFormats.d.ts +58 -0
- package/dist/util/catalogueFileFormats.js +64 -0
- package/dist/util/devLog.d.ts +11 -0
- package/dist/util/devLog.js +23 -0
- package/dist/util/fileName.d.ts +18 -0
- package/dist/util/fileName.js +45 -0
- package/dist/util/wfsVersions.d.ts +9 -0
- package/dist/util/wfsVersions.js +13 -0
- package/package.json +47 -4
- package/src/schema/quac.schema.json +935 -0
|
@@ -0,0 +1,722 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed in-memory representation of a parsed QGIS project (.qgs) file.
|
|
3
|
+
*
|
|
4
|
+
* Every top-level type has an optional rawXml field — the original XML
|
|
5
|
+
* node serialised back to a string. This lets future parsers (forms,
|
|
6
|
+
* relations, virtual fields, joins) extract additional information without
|
|
7
|
+
* re-parsing the .qgs from scratch.
|
|
8
|
+
*
|
|
9
|
+
* The model is intentionally a flat, plain-data representation: no methods,
|
|
10
|
+
* no class instances, just JSON-shaped objects so that:
|
|
11
|
+
* - it serialises trivially with the workspace
|
|
12
|
+
* - it round-trips cleanly through tests
|
|
13
|
+
* - future server-side hosting can reuse the same types
|
|
14
|
+
*/
|
|
15
|
+
import type { DelimitedTextOptions } from './delimitedText.ts';
|
|
16
|
+
import type { FeatureFilter } from './featureFilter.ts';
|
|
17
|
+
import type { TableColumnValueRelation } from './Stac.ts';
|
|
18
|
+
/** The unit names QGIS saves under <Measurement> (`QgsUnitTypes::encodeUnit`), such as `ha` and `meters`. */
|
|
19
|
+
export interface ProjectMeasurement {
|
|
20
|
+
areaUnit: string;
|
|
21
|
+
distanceUnit: string;
|
|
22
|
+
}
|
|
23
|
+
export interface QgsProject {
|
|
24
|
+
/** QGIS version that wrote the project (e.g. "3.44.8-Solothurn"). */
|
|
25
|
+
qgisVersion: string | null;
|
|
26
|
+
/** Project title from <title>; empty string if absent. */
|
|
27
|
+
title: string;
|
|
28
|
+
/** Project CRS authority id (e.g. "EPSG:4326"); null if not declared. */
|
|
29
|
+
projectCrs: string | null;
|
|
30
|
+
/** Initial map view extent from <mapcanvas><extent>. */
|
|
31
|
+
mapExtent: MapExtent | null;
|
|
32
|
+
/** Vector / raster layers from <projectlayers>. Annotation layers are filtered out. */
|
|
33
|
+
layers: LayerEntry[];
|
|
34
|
+
/** Display tree from <layer-tree-group> — root group with children. */
|
|
35
|
+
layerTree: LayerGroup;
|
|
36
|
+
/** Relations from <relations>, each joining a parent layer to a child layer. */
|
|
37
|
+
relations?: QgsRelation[];
|
|
38
|
+
/** Project-level <projectMetadata>, as far as Groundwork reads it. */
|
|
39
|
+
metadata: ProjectMetadata;
|
|
40
|
+
/** The area and distance units `$area`, `$length` and `$perimeter` are given in; null where the project saves none. */
|
|
41
|
+
measurement?: ProjectMeasurement | null;
|
|
42
|
+
/** The project colour labelled Brand, in QGIS's colour-string form (`parseBrandColour`); null or absent where the project has none. */
|
|
43
|
+
brandColour?: string | null;
|
|
44
|
+
/** The project's own variables (Project Properties > Variables) by name (`parseProjectVariables`); absent or empty where it has none. */
|
|
45
|
+
variables?: Record<string, string>;
|
|
46
|
+
/** The layer id QFieldSync names as the project's **Initial active layer** (`parseInitialActiveLayerId`); null or absent where it names none. */
|
|
47
|
+
initialActiveLayerId?: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* The layers the project publishes for WFS from QGIS Server, and which of
|
|
50
|
+
* them take each WFS-T operation (`parseWfsTransactionLayers`). Null or absent
|
|
51
|
+
* where the project saves no WFS publishing.
|
|
52
|
+
*/
|
|
53
|
+
wfsTransactionLayers?: WfsTransactionLayers | null;
|
|
54
|
+
/** The project's WMS publishing from QGIS Server (`parseWmsPublishing`); null or absent where it saves none. */
|
|
55
|
+
wmsPublishing?: WmsPublishing | null;
|
|
56
|
+
/** The CRSs the project restricts its WMS layers to (`parseWmsCrsList`); absent or empty where it restricts none. */
|
|
57
|
+
wmsCrsList?: string[];
|
|
58
|
+
/**
|
|
59
|
+
* The filters the Mergin Maps plugin sets up for the project, in its order
|
|
60
|
+
* (`parseMerginFilters`); absent or empty where it sets none.
|
|
61
|
+
*/
|
|
62
|
+
merginFilters?: PresetFilter[];
|
|
63
|
+
/** Original full QGS XML, retained so future parsers can re-mine without re-loading. */
|
|
64
|
+
rawXml: string | null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The parts of QGIS's project-level `<projectMetadata>` Groundwork reads.
|
|
68
|
+
* QGIS's own dialog (Project Properties > Metadata) writes the element on
|
|
69
|
+
* every project, empty fields and all — `abstract` and `author` are null only
|
|
70
|
+
* when the author left them blank, checked against a saved QGIS project
|
|
71
|
+
* and `packages/quac/src/tests/fixtures/qgis/graffiti/graffiti.qgs` on 2026-08-12.
|
|
72
|
+
*/
|
|
73
|
+
export interface ProjectMetadata {
|
|
74
|
+
/** From `<projectMetadata><abstract>`; null when blank. */
|
|
75
|
+
abstract: string | null;
|
|
76
|
+
/** From `<projectMetadata><author>`; null when blank. */
|
|
77
|
+
author: string | null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* One `<relations><relation>` entry: two layers and the field pair(s) joining
|
|
81
|
+
* them. QGIS's *referenced* layer is the parent and its *referencing* layer the
|
|
82
|
+
* child, named here as parent and child.
|
|
83
|
+
*/
|
|
84
|
+
export interface QgsRelation {
|
|
85
|
+
/** Relation id from the `id` attribute. */
|
|
86
|
+
id: string;
|
|
87
|
+
/** Display name from the `name` attribute; empty when the project declares none. */
|
|
88
|
+
name: string;
|
|
89
|
+
/** Layer id of the parent — QGIS's `referencedLayer`. */
|
|
90
|
+
parentLayerId: string;
|
|
91
|
+
/** Layer id of the child — QGIS's `referencingLayer`. */
|
|
92
|
+
childLayerId: string;
|
|
93
|
+
/** The field pairs joining the two, in file order. Several make one composite key. */
|
|
94
|
+
fieldPairs: QgsRelationFieldPair[];
|
|
95
|
+
/** QGIS's `strength` attribute as written; null when the project declares none. */
|
|
96
|
+
strength: string | null;
|
|
97
|
+
}
|
|
98
|
+
/** One `<fieldRef>` of a relation — one field on each side of the join. */
|
|
99
|
+
export interface QgsRelationFieldPair {
|
|
100
|
+
/** Field on the parent layer — QGIS's `referencedField`. */
|
|
101
|
+
parentField: string;
|
|
102
|
+
/** Field on the child layer — QGIS's `referencingField`. */
|
|
103
|
+
childField: string;
|
|
104
|
+
}
|
|
105
|
+
export interface MapExtent {
|
|
106
|
+
xmin: number;
|
|
107
|
+
ymin: number;
|
|
108
|
+
xmax: number;
|
|
109
|
+
ymax: number;
|
|
110
|
+
/** CRS authority id (falls back to project CRS when omitted at the canvas level). */
|
|
111
|
+
crs: string | null;
|
|
112
|
+
}
|
|
113
|
+
/** Bounding box without CRS — used inside layers, which have their own crs separately. */
|
|
114
|
+
export interface BoundingBox {
|
|
115
|
+
xmin: number;
|
|
116
|
+
ymin: number;
|
|
117
|
+
xmax: number;
|
|
118
|
+
ymax: number;
|
|
119
|
+
}
|
|
120
|
+
export interface LayerEntry {
|
|
121
|
+
/** Unique id from <id> — used to cross-reference layer-tree leaves. */
|
|
122
|
+
id: string;
|
|
123
|
+
/** Display name from <layername>. */
|
|
124
|
+
name: string;
|
|
125
|
+
/** Layer type from the maplayer's `type` attribute (e.g. "vector", "raster"). */
|
|
126
|
+
type: string;
|
|
127
|
+
/** Geometry type as QGIS names it, from the `geometry` attribute (e.g. "Point", "Line"); null for non-vector. */
|
|
128
|
+
geometryType: string | null;
|
|
129
|
+
/** WKB geometry type name from the `wkbType` attribute (e.g. "MultiLineString"); null or absent where the project writes none. */
|
|
130
|
+
wkbType?: string | null;
|
|
131
|
+
/** The layer's **Short name**, from Layer Properties → QGIS Server; null or absent where it has none. */
|
|
132
|
+
shortName?: string | null;
|
|
133
|
+
/** Layer-level CRS authority id (e.g. "EPSG:4326"). */
|
|
134
|
+
crs: string | null;
|
|
135
|
+
/** Layer's declared bounding box, in the layer CRS. */
|
|
136
|
+
extent: BoundingBox | null;
|
|
137
|
+
/**
|
|
138
|
+
* Layer's bounding box in WGS84 (EPSG:4326), as captured by QGIS in
|
|
139
|
+
* `<wgs84extent>`. Preferred over `extent` for STAC catalogue output
|
|
140
|
+
* because STAC requires WGS84 bboxes. Null if QGIS didn't write it.
|
|
141
|
+
*/
|
|
142
|
+
wgs84Extent: BoundingBox | null;
|
|
143
|
+
/** Parsed datasource descriptor — file, WFS, WMS, XYZ, WMTS or unsupported. */
|
|
144
|
+
dataSource: DataSource;
|
|
145
|
+
/**
|
|
146
|
+
* Field nominated by QGIS as the layer's display attribute (its title
|
|
147
|
+
* field) — extracted from `<previewExpression>"fieldname"</previewExpression>`.
|
|
148
|
+
* Null when no preview expression is set or the expression isn't a
|
|
149
|
+
* simple field reference.
|
|
150
|
+
*/
|
|
151
|
+
displayField: string | null;
|
|
152
|
+
/**
|
|
153
|
+
* Whether the layer is checked in the QGIS layer tree. Computed by
|
|
154
|
+
* walking the parsed `layerTree` and propagating parent-group state
|
|
155
|
+
* through to leaves. Defaults to true if the layer isn't in the tree.
|
|
156
|
+
*/
|
|
157
|
+
isVisible: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Whether the layer is queryable for GetFeatureInfo / identify in QGIS
|
|
160
|
+
* — extracted from `<flags><Identifiable>1</Identifiable></flags>`.
|
|
161
|
+
* Defaults to true when the flags element is absent.
|
|
162
|
+
*/
|
|
163
|
+
queryable: boolean;
|
|
164
|
+
/** Layer opacity 0..1 — from `<layerOpacity>`. Defaults to 1 when absent. */
|
|
165
|
+
opacity: number;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the layer is editable. Negation of QGIS's `readOnly` attribute
|
|
168
|
+
* on `<maplayer>`. Defaults to true when the attribute is absent or "0".
|
|
169
|
+
*/
|
|
170
|
+
editable: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Canonical list of field names declared in QGIS's <fieldConfiguration>.
|
|
173
|
+
* Used as the seed for STAC `table:columns` so the schema is known even
|
|
174
|
+
* before any feature data has loaded (relevant for WFS-backed layers).
|
|
175
|
+
*/
|
|
176
|
+
fieldNames: string[];
|
|
177
|
+
/**
|
|
178
|
+
* Map of field name → human-readable alias as declared in QGIS's
|
|
179
|
+
* <aliases> element. Empty entries (alias name="") are filtered out so
|
|
180
|
+
* the field name itself becomes the display label by default. Used by
|
|
181
|
+
* Phase 5 to populate the `title` field on STAC `table:columns`.
|
|
182
|
+
*/
|
|
183
|
+
fieldAliases: Record<string, string>;
|
|
184
|
+
/**
|
|
185
|
+
* The fields QGIS Server leaves out of WMS (GetProjectSettings, GetFeatureInfo)
|
|
186
|
+
* and of WFS (DescribeFeatureType, GetFeature): the **WMS** and **WFS**
|
|
187
|
+
* checkboxes in the Attributes Form's QGIS Server settings. Absent where the
|
|
188
|
+
* layer hides none.
|
|
189
|
+
*/
|
|
190
|
+
serverHiddenFields?: ServerHiddenFields;
|
|
191
|
+
/**
|
|
192
|
+
* All named styles defined for the layer. QGIS allows multiple symbology
|
|
193
|
+
* styles per layer (e.g. "Asset Owner" + "Priority") with one currently
|
|
194
|
+
* applied. Phase 3+ uses the active one for rendering; the dev panel can
|
|
195
|
+
* inspect them all.
|
|
196
|
+
*/
|
|
197
|
+
styles: LayerStyle[];
|
|
198
|
+
/** Index into styles[] of the active style; -1 if no styles were captured. */
|
|
199
|
+
activeStyleIndex: number;
|
|
200
|
+
/** The layer's `<resourceMetadata>`, as far as Groundwork reads it. */
|
|
201
|
+
resourceMetadata: LayerResourceMetadata;
|
|
202
|
+
/** The layer's `<attribution>` element — a credit line, separate from resourceMetadata. */
|
|
203
|
+
attribution: LayerAttribution | null;
|
|
204
|
+
/**
|
|
205
|
+
* ValueMap edit widget picklists, keyed by field name — the display label a
|
|
206
|
+
* user sees mapped to the value QGIS stores. Fields with no ValueMap widget,
|
|
207
|
+
* or a widget with no entries, are absent from the map.
|
|
208
|
+
*/
|
|
209
|
+
fieldValueMaps: Record<string, FieldValueMapEntry[]>;
|
|
210
|
+
/**
|
|
211
|
+
* Whether the layer's Private flag is ticked in QGIS (`<flags><Private>`),
|
|
212
|
+
* which keeps it out of the legend. False when the flag is absent.
|
|
213
|
+
*/
|
|
214
|
+
isPrivate: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* The legend placeholder image the layer embeds (*Layer Properties → Legend*,
|
|
217
|
+
* saved as `legendPlaceholderImage`), as a `data:` URL. Null where the layer
|
|
218
|
+
* sets none, or sets a file or a web address in place of an embedded image.
|
|
219
|
+
*/
|
|
220
|
+
legendImage?: string | null;
|
|
221
|
+
/**
|
|
222
|
+
* Value Relation edit widgets, keyed by field name — the fields whose
|
|
223
|
+
* choices QGIS reads from another layer of the project. Fields with no such
|
|
224
|
+
* widget are absent.
|
|
225
|
+
*/
|
|
226
|
+
fieldValueRelations: Record<string, FieldValueRelation>;
|
|
227
|
+
/**
|
|
228
|
+
* Attachment edit widgets, keyed by field name — the fields QGIS declares as
|
|
229
|
+
* holding a file rather than text. Fields with no such widget are absent.
|
|
230
|
+
*/
|
|
231
|
+
fieldAttachments: Record<string, FieldAttachment>;
|
|
232
|
+
/**
|
|
233
|
+
* What the Attributes Form says about changing each field: whether its
|
|
234
|
+
* Editable box is unticked, and a default value Groundwork can fill in.
|
|
235
|
+
* Fields with neither are absent.
|
|
236
|
+
*/
|
|
237
|
+
fieldEditRules: Record<string, FieldEditRule>;
|
|
238
|
+
/**
|
|
239
|
+
* The address of the layer's own icon, from its `quac_icon` variable. Null
|
|
240
|
+
* or absent where it sets none.
|
|
241
|
+
*/
|
|
242
|
+
icon?: string | null;
|
|
243
|
+
/**
|
|
244
|
+
* The address of each field's icon, from the layer's `quac_icon_<field>`
|
|
245
|
+
* variables. Fields with none are absent.
|
|
246
|
+
*/
|
|
247
|
+
fieldIcons?: Record<string, string>;
|
|
248
|
+
/**
|
|
249
|
+
* The control each field's `quac_control_<field>` variable asks for. Fields
|
|
250
|
+
* with none are absent.
|
|
251
|
+
*/
|
|
252
|
+
fieldControls?: Record<string, FieldControl>;
|
|
253
|
+
/**
|
|
254
|
+
* The fields the layer's Drag and Drop Designer form places, with the
|
|
255
|
+
* visibility expressions around each. Null or absent where the layer's form
|
|
256
|
+
* is not set to the Drag and Drop Designer.
|
|
257
|
+
*/
|
|
258
|
+
formLayout?: LayerFormLayout | null;
|
|
259
|
+
/**
|
|
260
|
+
* The scales the layer is drawn between, from QGIS's scale-dependent
|
|
261
|
+
* visibility. Null when the layer has it switched off or sets no limit.
|
|
262
|
+
*/
|
|
263
|
+
scaleRange: LayerScaleRange | null;
|
|
264
|
+
/**
|
|
265
|
+
* The edits the QFieldSync plugin locks on the layer (`parseQfieldSyncLocks`).
|
|
266
|
+
* Absent or empty where it locks none.
|
|
267
|
+
*/
|
|
268
|
+
locks?: LayerLocks;
|
|
269
|
+
/** Full <maplayer> XML, retained so future parsers (forms, fields, etc.) can re-mine. */
|
|
270
|
+
rawXml: string | null;
|
|
271
|
+
}
|
|
272
|
+
/** An edit a lock can stop: adding a feature, changing its attributes or its geometry, or deleting it. */
|
|
273
|
+
export type LockedEdit = 'add' | 'attributes' | 'geometry' | 'delete';
|
|
274
|
+
/** A lock: on for every feature, or on for a feature while a QGIS expression comes out true for it. */
|
|
275
|
+
export type EditLock = true | {
|
|
276
|
+
expression: string;
|
|
277
|
+
};
|
|
278
|
+
/** The edits locked on a layer. An edit with no entry is not locked. */
|
|
279
|
+
export type LayerLocks = Partial<Record<LockedEdit, EditLock>>;
|
|
280
|
+
/** A filter a project sets up on one field of one layer, under the name it gives it. */
|
|
281
|
+
export interface PresetFilter {
|
|
282
|
+
layerId: string;
|
|
283
|
+
field: string;
|
|
284
|
+
/** The name the filter is shown under; null where the project gives none. */
|
|
285
|
+
name: string | null;
|
|
286
|
+
}
|
|
287
|
+
/** From Project Properties → QGIS Server → WMS capabilities. */
|
|
288
|
+
export interface WmsPublishing {
|
|
289
|
+
/** **Use layer ids as names** is ticked, so QGIS Server names each layer by its layer id. */
|
|
290
|
+
useLayerIds: boolean;
|
|
291
|
+
/** The names of the layers left out of WMS. */
|
|
292
|
+
restrictedLayers: string[];
|
|
293
|
+
}
|
|
294
|
+
/** Layer ids, from Project Properties → QGIS Server → WFS capabilities. */
|
|
295
|
+
export interface WfsTransactionLayers {
|
|
296
|
+
/** The layers ticked **Published**. */
|
|
297
|
+
published: string[];
|
|
298
|
+
/** The published layers ticked **Insert**. */
|
|
299
|
+
insert: string[];
|
|
300
|
+
/** The published layers ticked **Update**. */
|
|
301
|
+
update: string[];
|
|
302
|
+
/** The published layers ticked **Delete**. */
|
|
303
|
+
delete: string[];
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* The parts of QGIS's per-layer `<resourceMetadata>` Groundwork reads.
|
|
307
|
+
* `abstract`, `contacts` and `temporalInterval`'s `<period>` shape verified
|
|
308
|
+
* against a saved QGIS project, whose `<resourceMetadata>`
|
|
309
|
+
* has those fields written but empty on that fixture. `<license>` and
|
|
310
|
+
* `temporalInterval`'s `<instant>` alternative are absent from every fixture
|
|
311
|
+
* in this repo, so those shapes are verified instead against
|
|
312
|
+
* `QgsLayerMetadata`'s XML read/write code (`src/core/metadata/qgslayermetadata.cpp`,
|
|
313
|
+
* `qgis/QGIS@master`, read 2026-08-12). `<keywords>` is likewise absent from
|
|
314
|
+
* every fixture, but its read/write code is in the base class instead
|
|
315
|
+
* (`QgsAbstractMetadataBase::readMetadataXml`/`writeMetadataXml`,
|
|
316
|
+
* `src/core/metadata/qgsabstractmetadatabase.cpp`, same commit).
|
|
317
|
+
*/
|
|
318
|
+
export interface LayerResourceMetadata {
|
|
319
|
+
/** From `<resourceMetadata><abstract>`; null when blank. */
|
|
320
|
+
abstract: string | null;
|
|
321
|
+
/**
|
|
322
|
+
* The first non-blank `<resourceMetadata><license>` element's text — QGIS
|
|
323
|
+
* writes each licence as its own sibling `<license>` element rather than a
|
|
324
|
+
* wrapper holding several. Null when the layer declares none.
|
|
325
|
+
*/
|
|
326
|
+
license: string | null;
|
|
327
|
+
/** Every `<keyword>` text inside any `<resourceMetadata><keywords>` block, deduplicated in order. */
|
|
328
|
+
keywords: string[];
|
|
329
|
+
/** Every `<resourceMetadata><contact>` with a name or organisation. */
|
|
330
|
+
contacts: LayerContact[];
|
|
331
|
+
/**
|
|
332
|
+
* `<resourceMetadata><extent><temporal>`'s declared range, as ISO text —
|
|
333
|
+
* a `<period><start>`/`<end>`, or a single `<instant>` read as both ends
|
|
334
|
+
* (see `parseResourceMetadataTemporal` in `packages/quac/src/parse/parseLayers.ts`
|
|
335
|
+
* for which of the two is fixture-verified and which is checked against
|
|
336
|
+
* QGIS source only). Null when the layer declares neither.
|
|
337
|
+
*/
|
|
338
|
+
temporalInterval: [string | null, string | null] | null;
|
|
339
|
+
}
|
|
340
|
+
export interface LayerContact {
|
|
341
|
+
name: string;
|
|
342
|
+
organization: string;
|
|
343
|
+
email: string;
|
|
344
|
+
}
|
|
345
|
+
/** QGIS's per-layer `<attribution href="...">text</attribution>` — a credit line. */
|
|
346
|
+
export interface LayerAttribution {
|
|
347
|
+
text: string;
|
|
348
|
+
href: string | null;
|
|
349
|
+
}
|
|
350
|
+
/** One entry of a ValueMap edit widget's picklist. */
|
|
351
|
+
export interface FieldValueMapEntry {
|
|
352
|
+
/** The value QGIS stores in the field. */
|
|
353
|
+
value: string;
|
|
354
|
+
/** The label shown for that value. */
|
|
355
|
+
label: string;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* A field's Value Relation edit widget, as far as Groundwork reads it: the
|
|
359
|
+
* lookup layer it names, the fields stored and shown, and how the list is
|
|
360
|
+
* filtered and ordered. The widget's group, description, column count and
|
|
361
|
+
* completer settings are not read.
|
|
362
|
+
*/
|
|
363
|
+
export interface FieldValueRelation {
|
|
364
|
+
/** The lookup layer's id (`Layer`); empty when the widget names none. */
|
|
365
|
+
layerId: string;
|
|
366
|
+
/** The lookup layer's name (`LayerName`), tried when no layer has `layerId`. */
|
|
367
|
+
layerName: string;
|
|
368
|
+
/** The lookup field whose value is stored (`Key`). */
|
|
369
|
+
keyField: string;
|
|
370
|
+
/** The lookup field whose value is shown (`Value`). */
|
|
371
|
+
valueField: string;
|
|
372
|
+
/** The QGIS expression narrowing the list (`FilterExpression`); empty for none. */
|
|
373
|
+
filterExpression: string;
|
|
374
|
+
/** Whether the list offers a blank choice (`AllowNull`). */
|
|
375
|
+
allowNull: boolean;
|
|
376
|
+
/** Whether the field stores several keys (`AllowMulti`). */
|
|
377
|
+
allowMulti: boolean;
|
|
378
|
+
/** What orders the list: its key, its shown value, or another field of the lookup. */
|
|
379
|
+
orderBy: 'key' | 'value' | 'field';
|
|
380
|
+
/** The lookup field the list is ordered by, where `orderBy` is `field`. */
|
|
381
|
+
orderField: string | null;
|
|
382
|
+
/** Whether the order is reversed (`OrderByDescending`). */
|
|
383
|
+
descending: boolean;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* A field's Attachment edit widget, as far as Groundwork reads it. QGIS calls
|
|
387
|
+
* the widget `ExternalResource`; the field holds a file's path rather than
|
|
388
|
+
* text.
|
|
389
|
+
*/
|
|
390
|
+
export interface FieldAttachment {
|
|
391
|
+
/** What QGIS's document viewer shows for the file. Null where the widget shows none. */
|
|
392
|
+
viewer: 'image' | 'web' | 'audio' | 'video' | null;
|
|
393
|
+
/** The file-picker filter QGIS offers, e.g. `Images (*.jpg *.png)`. Null when unset. */
|
|
394
|
+
filter: string | null;
|
|
395
|
+
/** The widget's declared root folder, verbatim. Null when unset. */
|
|
396
|
+
defaultRoot: string | null;
|
|
397
|
+
/** What a stored path is relative to. */
|
|
398
|
+
relativeStorage: 'absolute' | 'project' | 'default-root';
|
|
399
|
+
}
|
|
400
|
+
/** A layer's Drag and Drop Designer form, as far as Groundwork reads it: which fields it places, in its order. */
|
|
401
|
+
export interface LayerFormLayout {
|
|
402
|
+
fields: FormLayoutField[];
|
|
403
|
+
}
|
|
404
|
+
/** A field the form places. */
|
|
405
|
+
export interface FormLayoutField {
|
|
406
|
+
name: string;
|
|
407
|
+
/**
|
|
408
|
+
* The visibility expressions of the containers around the field, outermost
|
|
409
|
+
* first, each as QGIS wrote it. Only an enabled, non-blank expression is
|
|
410
|
+
* listed; the field shows while all of them are true.
|
|
411
|
+
*/
|
|
412
|
+
visibleWhen: string[];
|
|
413
|
+
/**
|
|
414
|
+
* The QGIS expression behind the field's data-defined Editable property:
|
|
415
|
+
* the field is locked while it comes out false. A field-type property is the
|
|
416
|
+
* field in double quotes, a static one `true` or `false`. Absent where the
|
|
417
|
+
* field has no active property.
|
|
418
|
+
*/
|
|
419
|
+
editableWhen?: string;
|
|
420
|
+
}
|
|
421
|
+
/** What a field's form settings say about changing it. */
|
|
422
|
+
export interface FieldEditRule {
|
|
423
|
+
/** True where the source shows the field but does not let anyone change it. */
|
|
424
|
+
readOnly: boolean;
|
|
425
|
+
/** The value the field is filled with, or null where the source declares none Groundwork can fill. */
|
|
426
|
+
defaultValue: FieldDefaultValue | null;
|
|
427
|
+
/**
|
|
428
|
+
* The field's Not null constraint: `enforced` refuses a blank, `warn` lets
|
|
429
|
+
* it save with a warning. Null where the source sets none.
|
|
430
|
+
*/
|
|
431
|
+
notNull: 'enforced' | 'warn' | null;
|
|
432
|
+
/**
|
|
433
|
+
* The field's Unique constraint: `enforced` refuses a value another feature
|
|
434
|
+
* holds, `warn` lets it save with a warning. Null or absent where the source sets none.
|
|
435
|
+
*/
|
|
436
|
+
unique?: 'enforced' | 'warn' | null;
|
|
437
|
+
/**
|
|
438
|
+
* What the field does when a feature is duplicated: `default` takes the
|
|
439
|
+
* field's default value, or stays blank where it has none; `unset` clears it.
|
|
440
|
+
* Null or absent where the value is passed on, QGIS's `Duplicate`.
|
|
441
|
+
*/
|
|
442
|
+
duplicatePolicy?: 'default' | 'unset' | null;
|
|
443
|
+
/**
|
|
444
|
+
* The field's constraint expression, kept as the source wrote it. Null or
|
|
445
|
+
* absent where the source sets none or sets one that `readQgisExpression`
|
|
446
|
+
* cannot read.
|
|
447
|
+
*/
|
|
448
|
+
constraintExpression?: FieldConstraintExpression | null;
|
|
449
|
+
/**
|
|
450
|
+
* An expression that fills the field, kept as the source wrote it. Null or
|
|
451
|
+
* absent where the default is another kind (`defaultValue`), the source
|
|
452
|
+
* sets none, or its expression cannot be read.
|
|
453
|
+
*/
|
|
454
|
+
defaultExpression?: FieldDefaultExpression | null;
|
|
455
|
+
/** True where the source's form never shows the field. */
|
|
456
|
+
hidden: boolean;
|
|
457
|
+
/** True where a new feature or record is offered the value last entered in the field. */
|
|
458
|
+
reuseLastValue: boolean;
|
|
459
|
+
/**
|
|
460
|
+
* The field's Value Relation, where its choices come from another table and the
|
|
461
|
+
* field stores one key. `allowNull` is the widget's Allow NULL value: the list
|
|
462
|
+
* offers a blank choice. `relation` is the column's whole `quac:value_relation`,
|
|
463
|
+
* for the edit form's filter. Null or absent where the field has none.
|
|
464
|
+
*/
|
|
465
|
+
valueRelation?: {
|
|
466
|
+
allowNull: boolean;
|
|
467
|
+
relation?: TableColumnValueRelation;
|
|
468
|
+
} | null;
|
|
469
|
+
/** The field's Checkbox widget. Null or absent where it has none. */
|
|
470
|
+
checkbox?: FieldCheckbox | null;
|
|
471
|
+
/** The limits and number format of a Range widget or an ArcGIS range domain. Null or absent where none is set. */
|
|
472
|
+
range?: FieldRange | null;
|
|
473
|
+
/**
|
|
474
|
+
* The format a text field stores its dates in, as a QGIS date pattern such
|
|
475
|
+
* as `dd/MM/yyyy`. Null or absent where the field stores the default
|
|
476
|
+
* `yyyy-MM-dd` or ISO 8601.
|
|
477
|
+
*/
|
|
478
|
+
dateFormat?: string | null;
|
|
479
|
+
/** True where the field holds a colour: a QGIS Color widget. */
|
|
480
|
+
colour?: boolean;
|
|
481
|
+
/** The `https://` address of the icon drawn beside the field's name. Null or absent where it has none. */
|
|
482
|
+
icon?: string | null;
|
|
483
|
+
/** The control the edit form draws the field's choices with. Null or absent where the source asks for none. */
|
|
484
|
+
control?: FieldControl | null;
|
|
485
|
+
}
|
|
486
|
+
/** How the edit form draws a field's list of choices: a row of `buttons`, or a `dropdown`. */
|
|
487
|
+
export type FieldControl = 'buttons' | 'dropdown';
|
|
488
|
+
/**
|
|
489
|
+
* A QGIS constraint expression. `enforced` refuses a save whose value is not
|
|
490
|
+
* true, `warn` saves with a warning. `description` is the message the source
|
|
491
|
+
* gives for it; absent where it gives none.
|
|
492
|
+
*/
|
|
493
|
+
export interface FieldConstraintExpression {
|
|
494
|
+
expression: string;
|
|
495
|
+
description?: string;
|
|
496
|
+
strength: 'enforced' | 'warn';
|
|
497
|
+
}
|
|
498
|
+
/** A default value worked out from the feature's other values; `onUpdate` fills it on every save rather than only the one creating the feature. */
|
|
499
|
+
export interface FieldDefaultExpression {
|
|
500
|
+
expression: string;
|
|
501
|
+
onUpdate: boolean;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* A Checkbox widget. A state the widget leaves unset is null, and a boolean
|
|
505
|
+
* field ignores both states.
|
|
506
|
+
*/
|
|
507
|
+
export interface FieldCheckbox {
|
|
508
|
+
/** The value a ticked box writes to a text field. */
|
|
509
|
+
checkedValue: string | null;
|
|
510
|
+
/** The value an unticked box writes to a text field. */
|
|
511
|
+
uncheckedValue: string | null;
|
|
512
|
+
/** True where the project shows the stored value rather than true and false. */
|
|
513
|
+
showStoredValue: boolean;
|
|
514
|
+
/** True where a blank is a third, partly ticked state. */
|
|
515
|
+
allowNull: boolean;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* A number field's limits and format. Each member is set only where the source
|
|
519
|
+
* sets it: an absent one takes QGIS's default of 1 for the step, none for the
|
|
520
|
+
* decimal places and none for the suffix.
|
|
521
|
+
*/
|
|
522
|
+
export interface FieldRange {
|
|
523
|
+
min?: number;
|
|
524
|
+
max?: number;
|
|
525
|
+
step?: number;
|
|
526
|
+
/** The number of decimal places the field shows. */
|
|
527
|
+
precision?: number;
|
|
528
|
+
/** Text shown after the number in the edit form. */
|
|
529
|
+
suffix?: string;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* A default value: `now` is the moment the feature is created, or saved where
|
|
533
|
+
* `onUpdate` is set, written as the field's type holds it; `uuid` is a new
|
|
534
|
+
* random identifier written in `format`; `fixed` is `value` as the source
|
|
535
|
+
* wrote it.
|
|
536
|
+
*/
|
|
537
|
+
export type FieldDefaultValue = {
|
|
538
|
+
kind: 'now';
|
|
539
|
+
onUpdate: boolean;
|
|
540
|
+
} | {
|
|
541
|
+
kind: 'uuid';
|
|
542
|
+
format: FieldUuidFormat;
|
|
543
|
+
onUpdate: boolean;
|
|
544
|
+
} | {
|
|
545
|
+
kind: 'fixed';
|
|
546
|
+
value: FieldFixedValue;
|
|
547
|
+
onUpdate: boolean;
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
* How a `uuid` default is written, as QGIS's `uuid()` names its formats:
|
|
551
|
+
* `{6f1e…}`, `6f1e…` with its hyphens, or 32 hex digits without them.
|
|
552
|
+
*/
|
|
553
|
+
export type FieldUuidFormat = 'with_braces' | 'without_braces' | 'id128';
|
|
554
|
+
/** A fixed default, typed as QGIS's expression parser reads the literal. */
|
|
555
|
+
export type FieldFixedValue = string | number | boolean | null;
|
|
556
|
+
/**
|
|
557
|
+
* A layer's visible scale range, as scale denominators (10000 is 1:10,000).
|
|
558
|
+
* Named as QGIS names them: the layer draws once you zoom in past `minScale`
|
|
559
|
+
* (exclusive) and stops after `maxScale` (inclusive, the most zoomed-in scale
|
|
560
|
+
* it still draws at), so `minScale` is the larger number. Null on either side
|
|
561
|
+
* means no limit that way. The two boundaries are the ones QGIS's own fields
|
|
562
|
+
* are labelled with, "Minimum (exclusive)" and "Maximum (inclusive)"
|
|
563
|
+
* (`QgsScaleRangeWidget`, `src/gui/qgsscalerangewidget.cpp`, `qgis/QGIS@master`,
|
|
564
|
+
* read 2026-10-04).
|
|
565
|
+
*/
|
|
566
|
+
export interface LayerScaleRange {
|
|
567
|
+
minScale: number | null;
|
|
568
|
+
maxScale: number | null;
|
|
569
|
+
}
|
|
570
|
+
export interface LayerStyle {
|
|
571
|
+
/** User-facing style name from QGIS's style manager (e.g. "Asset Owner"). */
|
|
572
|
+
name: string;
|
|
573
|
+
/** True if this style is the one currently applied to the layer. */
|
|
574
|
+
isActive: boolean;
|
|
575
|
+
/** Inline <renderer-v2> XML for this style; null if not present in the file. */
|
|
576
|
+
rendererV2RawXml: string | null;
|
|
577
|
+
/**
|
|
578
|
+
* The field a categorised renderer classifies by, as QGIS records it. Null for
|
|
579
|
+
* every other renderer type, and for a style whose renderer is absent.
|
|
580
|
+
*/
|
|
581
|
+
categorisedField: string | null;
|
|
582
|
+
/**
|
|
583
|
+
* Inline vector tile `<renderer>` XML for this style, on a vector tile layer
|
|
584
|
+
* whose file holds one: QGIS writes it in place of `<renderer-v2>`.
|
|
585
|
+
*/
|
|
586
|
+
vectorTileRendererRawXml?: string;
|
|
587
|
+
}
|
|
588
|
+
export type DataSource = FileDataSource | WfsDataSource | WmsDataSource | XyzDataSource | WmtsDataSource | ArcgisFeatureServerDataSource | UnsupportedDataSource;
|
|
589
|
+
export interface FileDataSource {
|
|
590
|
+
kind: 'file';
|
|
591
|
+
/** Basename of the data file — used for drag-drop companion matching. */
|
|
592
|
+
filename: string;
|
|
593
|
+
/**
|
|
594
|
+
* Full relative path as written in the QGS file, with backslashes normalised
|
|
595
|
+
* to forward slashes (e.g. 'data/roads.geojson' or './data/roads.geojson').
|
|
596
|
+
* Used by the remote project loader to match cloud folder listings.
|
|
597
|
+
* May equal filename when the QGS was authored with no directory prefix.
|
|
598
|
+
*/
|
|
599
|
+
relPath: string;
|
|
600
|
+
/** Optional sub-layer name (e.g. for GeoPackage); null if absent. */
|
|
601
|
+
layerName: string | null;
|
|
602
|
+
/**
|
|
603
|
+
* The address of an online file: a path QGIS reads through GDAL's
|
|
604
|
+
* `/vsicurl/` prefix, or an `http`/`https` path. Absent for a file on disk.
|
|
605
|
+
* `filename` is the address's last segment, and `relPath` the address.
|
|
606
|
+
*/
|
|
607
|
+
url?: string;
|
|
608
|
+
/**
|
|
609
|
+
* The one shape of feature the layer shows, from the source's
|
|
610
|
+
* `|geometrytype=` option, as QGIS splits a file holding several shapes into
|
|
611
|
+
* one layer per shape; null where the source names no shape this reads.
|
|
612
|
+
*/
|
|
613
|
+
geometryTypeFilter: 'Point' | 'LineString' | 'Polygon' | null;
|
|
614
|
+
/**
|
|
615
|
+
* How the file splits, where QGIS reads it with its Delimited Text provider
|
|
616
|
+
* rather than OGR: the separators, quotes and header its data source names.
|
|
617
|
+
*/
|
|
618
|
+
delimitedText?: DelimitedTextOptions;
|
|
619
|
+
/** The filter QGIS sets on the layer's data (Provider Feature Filter), so the layer holds only the features it keeps. */
|
|
620
|
+
featureFilter?: FeatureFilter;
|
|
621
|
+
/** Original raw <datasource> string. */
|
|
622
|
+
raw: string;
|
|
623
|
+
}
|
|
624
|
+
export interface WfsDataSource {
|
|
625
|
+
kind: 'wfs';
|
|
626
|
+
url: string;
|
|
627
|
+
typeName: string;
|
|
628
|
+
srsName: string | null;
|
|
629
|
+
/** The filter QGIS sets on the layer (Provider Feature Filter): a QGIS expression, a `SELECT` statement or OGC Filter XML, which QGIS sends to the server as an OGC Filter. */
|
|
630
|
+
featureFilter?: FeatureFilter;
|
|
631
|
+
/** Original raw <datasource> string. */
|
|
632
|
+
raw: string;
|
|
633
|
+
}
|
|
634
|
+
export interface WmsDataSource {
|
|
635
|
+
kind: 'wms';
|
|
636
|
+
url: string;
|
|
637
|
+
layers: string[];
|
|
638
|
+
styles: string[];
|
|
639
|
+
format: string;
|
|
640
|
+
crs: string;
|
|
641
|
+
version: '1.1.1' | '1.3.0' | null;
|
|
642
|
+
transparent: boolean;
|
|
643
|
+
dimensions: Record<string, string>;
|
|
644
|
+
raw: string;
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* A QGIS XYZ tile layer: the `wms` provider with `type=xyz` for image tiles,
|
|
648
|
+
* or the `xyzvectortiles` provider for vector tiles.
|
|
649
|
+
*/
|
|
650
|
+
export interface XyzDataSource {
|
|
651
|
+
kind: 'xyz';
|
|
652
|
+
/** What each tile holds: an image, or vector features (Mapbox Vector Tile). */
|
|
653
|
+
tiles: 'image' | 'vector';
|
|
654
|
+
/**
|
|
655
|
+
* Absolute tile URL template, with QGIS's `{q}` written as Bing's `{quadkey}`.
|
|
656
|
+
* A vector template holds `{z}`, `{x}` and `{y}`.
|
|
657
|
+
*/
|
|
658
|
+
url: string;
|
|
659
|
+
/** The deepest zoom level QGIS requests (`zmax`); null when the source states none. */
|
|
660
|
+
maxZoom: number | null;
|
|
661
|
+
raw: string;
|
|
662
|
+
}
|
|
663
|
+
/** A QGIS WMTS layer: the `wms` provider with `tileMatrixSet`. */
|
|
664
|
+
export interface WmtsDataSource {
|
|
665
|
+
kind: 'wmts';
|
|
666
|
+
/** The service address with its WMTS request parameters removed, or the address of its capabilities document. */
|
|
667
|
+
url: string;
|
|
668
|
+
layer: string;
|
|
669
|
+
/** Style identifier; empty for the layer's default style. */
|
|
670
|
+
style: string;
|
|
671
|
+
tileMatrixSet: string;
|
|
672
|
+
/** Tile image media type, e.g. `image/png`. */
|
|
673
|
+
format: string;
|
|
674
|
+
/** Dimension values from QGIS's `tileDimensions`, e.g. `{ Time: '2024-01-01' }`. */
|
|
675
|
+
dimensions: Record<string, string>;
|
|
676
|
+
raw: string;
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* A QGIS layer read through its `arcgisfeatureserver` provider: one layer of
|
|
680
|
+
* an ArcGIS FeatureServer or MapServer, read through the service's query.
|
|
681
|
+
*/
|
|
682
|
+
export interface ArcgisFeatureServerDataSource {
|
|
683
|
+
kind: 'arcgis';
|
|
684
|
+
/** The service layer's address, `…/FeatureServer/{index}` or `…/MapServer/{index}`. */
|
|
685
|
+
url: string;
|
|
686
|
+
/** The filter QGIS sets on the layer (Provider Feature Filter), which QGIS sends to the service as its `where` clause. Null for none. */
|
|
687
|
+
where: string | null;
|
|
688
|
+
raw: string;
|
|
689
|
+
}
|
|
690
|
+
export interface UnsupportedDataSource {
|
|
691
|
+
kind: 'unsupported';
|
|
692
|
+
/** Original raw <datasource> string for diagnostics. */
|
|
693
|
+
raw: string;
|
|
694
|
+
/** Best-guess provider/protocol if detectable (e.g. "postgres", "wms"). */
|
|
695
|
+
hint: string | null;
|
|
696
|
+
}
|
|
697
|
+
/** A node in the layer panel display tree — either a group or a leaf referencing a layer. */
|
|
698
|
+
export type LayerTreeNode = LayerGroup | LayerTreeLeaf;
|
|
699
|
+
export interface LayerGroup {
|
|
700
|
+
kind: 'group';
|
|
701
|
+
/** Group name; the root group has empty name "". */
|
|
702
|
+
name: string;
|
|
703
|
+
/** Whether the group is checked in the layer panel. */
|
|
704
|
+
checked: boolean;
|
|
705
|
+
/** True when QGIS shows only one of its children at a time (`mutually-exclusive="1"`). */
|
|
706
|
+
mutuallyExclusive?: boolean;
|
|
707
|
+
children: LayerTreeNode[];
|
|
708
|
+
}
|
|
709
|
+
export interface LayerTreeLeaf {
|
|
710
|
+
kind: 'layer';
|
|
711
|
+
/** Layer id matching LayerEntry.id. */
|
|
712
|
+
layerId: string;
|
|
713
|
+
/** Display name (typically equals LayerEntry.name). */
|
|
714
|
+
name: string;
|
|
715
|
+
/** Whether the layer is checked in the layer panel. */
|
|
716
|
+
checked: boolean;
|
|
717
|
+
}
|
|
718
|
+
/** The fields of a layer QGIS Server hides, by the service that hides them. */
|
|
719
|
+
export interface ServerHiddenFields {
|
|
720
|
+
wms: string[];
|
|
721
|
+
wfs: string[];
|
|
722
|
+
}
|