@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,15 @@
|
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal STAC type definitions for the documents Groundwork generates.
|
|
3
|
+
*
|
|
4
|
+
* The shape these types describe — a Catalog of Collections, one Collection
|
|
5
|
+
* per layer, vendor fields under `quac:` —
|
|
6
|
+
* is written up in `packages/quac/spec/README.md`.
|
|
7
|
+
*
|
|
8
|
+
* STAC core (Item / Catalog / Collection) is an OGC Community Standard since
|
|
9
|
+
* Oct 2025. We model only the subset we emit — extension fields and unused
|
|
10
|
+
* core fields are reachable via the index signature.
|
|
11
|
+
*
|
|
12
|
+
* If validation needs grow beyond structural assertions, swap to a typed
|
|
13
|
+
* STAC library (e.g. stac-js or @radiantearth/stac-spec-typescript). For
|
|
14
|
+
* Phase 5 the inline types keep the dep tree small.
|
|
15
|
+
*/
|
|
16
|
+
export declare const STAC_VERSION: "1.1.0";
|
|
17
|
+
/** Anything STAC-shaped — Catalog, Collection, or Item. */
|
|
18
|
+
export type StacObject = StacCatalog | StacCollection;
|
|
19
|
+
export interface StacCatalog {
|
|
20
|
+
type: 'Catalog';
|
|
21
|
+
stac_version: typeof STAC_VERSION;
|
|
22
|
+
stac_extensions?: string[];
|
|
23
|
+
id: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
description: string;
|
|
26
|
+
links: StacLink[];
|
|
27
|
+
/**
|
|
28
|
+
* Phase 5 emits child Collections inline. A real server-side STAC endpoint
|
|
29
|
+
* splits them into separate documents at the URLs in `links` (rel=child).
|
|
30
|
+
* Keeping them inline here is convenient for dev-panel inspection.
|
|
31
|
+
*/
|
|
32
|
+
collections?: StacCollection[];
|
|
33
|
+
/** Nested Catalogs (used to model QGIS layer groups). */
|
|
34
|
+
catalogs?: StacCatalog[];
|
|
35
|
+
[extension: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface StacCollection {
|
|
38
|
+
type: 'Collection';
|
|
39
|
+
stac_version: typeof STAC_VERSION;
|
|
40
|
+
stac_extensions?: string[];
|
|
41
|
+
id: string;
|
|
42
|
+
title?: string;
|
|
43
|
+
description: string;
|
|
44
|
+
license: string;
|
|
45
|
+
/** Who produced, licensed or hosts the data — the source of the credit line. */
|
|
46
|
+
providers?: StacProvider[];
|
|
47
|
+
extent: StacExtent;
|
|
48
|
+
summaries?: Record<string, unknown>;
|
|
49
|
+
assets?: Record<string, StacAsset>;
|
|
50
|
+
links: StacLink[];
|
|
51
|
+
[extension: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* An organisation that had a hand in the Collection's data. STAC's `roles` are
|
|
55
|
+
* `licensor`, `producer`, `processor` and `host`. This is where credit lines
|
|
56
|
+
* come from — the app builds the on-screen attribution out of these names and
|
|
57
|
+
* URLs rather than storing a pre-written string.
|
|
58
|
+
*/
|
|
59
|
+
export interface StacProvider {
|
|
60
|
+
name: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
roles?: string[];
|
|
63
|
+
url?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A STAC Item — one record inside a Collection, and a GeoJSON Feature in its own
|
|
67
|
+
* right. A STAC API puts its data here rather than on the Collection, which is
|
|
68
|
+
* why `packages/quac/src/sources/stacItems.ts` exists: a Collection served by an API
|
|
69
|
+
* has no downloadable asset, and the Items inside it have them all.
|
|
70
|
+
*
|
|
71
|
+
* Only the fields Groundwork reads are named. `properties.datetime` is what
|
|
72
|
+
* orders an item list. An Item may have `start_datetime` / `end_datetime`
|
|
73
|
+
* instead; which of the three STAC requires was not established here — no
|
|
74
|
+
* specification document was reachable — so `readItemTimestamp` takes
|
|
75
|
+
* `datetime`, falling back to `start_datetime`, and `itemAsCollection` reads
|
|
76
|
+
* `end_datetime` for the interval end.
|
|
77
|
+
*/
|
|
78
|
+
export interface StacItem {
|
|
79
|
+
type: 'Feature';
|
|
80
|
+
stac_version: string;
|
|
81
|
+
stac_extensions?: string[];
|
|
82
|
+
id: string;
|
|
83
|
+
collection?: string;
|
|
84
|
+
bbox?: number[];
|
|
85
|
+
geometry: unknown;
|
|
86
|
+
properties: {
|
|
87
|
+
datetime?: string | null;
|
|
88
|
+
start_datetime?: string;
|
|
89
|
+
end_datetime?: string;
|
|
90
|
+
title?: string;
|
|
91
|
+
description?: string;
|
|
92
|
+
[extension: string]: unknown;
|
|
93
|
+
};
|
|
94
|
+
assets?: Record<string, StacAsset>;
|
|
95
|
+
links?: StacLink[];
|
|
96
|
+
[extension: string]: unknown;
|
|
97
|
+
}
|
|
98
|
+
export interface StacExtent {
|
|
99
|
+
spatial: {
|
|
100
|
+
bbox: number[][];
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* STAC core marks `temporal` as required on Collection extents. Sources
|
|
104
|
+
* that declare no temporal range emit the open interval `[[null, null]]`,
|
|
105
|
+
* which the spec defines as "unbounded at both ends". Real intervals fill
|
|
106
|
+
* in once a source declares one.
|
|
107
|
+
*/
|
|
108
|
+
temporal: {
|
|
109
|
+
interval: Array<Array<string | null>>;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface StacAsset {
|
|
113
|
+
href: string;
|
|
114
|
+
type?: string;
|
|
115
|
+
title?: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
roles?: string[];
|
|
118
|
+
[extension: string]: unknown;
|
|
119
|
+
}
|
|
120
|
+
export interface StacLink {
|
|
121
|
+
rel: string;
|
|
122
|
+
href: string;
|
|
123
|
+
type?: string;
|
|
124
|
+
title?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Extension fields a relation type has — the web-map-links extension puts
|
|
127
|
+
* `pmtiles:layers` on the link rather than on the entity.
|
|
128
|
+
*/
|
|
129
|
+
[extension: string]: unknown;
|
|
130
|
+
}
|
|
131
|
+
/** Table extension column descriptor (`table:columns`), at the version `TABLE_EXTENSION` names. */
|
|
132
|
+
export interface TableColumn {
|
|
133
|
+
name: string;
|
|
134
|
+
/**
|
|
135
|
+
* Human-readable field label declared by the source. Readers treat either
|
|
136
|
+
* `title` or `description` as the display label, with `title` taking
|
|
137
|
+
* precedence when both are present.
|
|
138
|
+
*/
|
|
139
|
+
title?: string;
|
|
140
|
+
/** The column's type: the `TableColumnType` an adapter maps the source's type to, or, for a QGIS Server type Groundwork does not map, its lowercased type name. */
|
|
141
|
+
type?: string;
|
|
142
|
+
/** The column's type as a STAC common metadata data type, written beside a `type` that maps to one. */
|
|
143
|
+
data_type?: TableColumnDataType;
|
|
144
|
+
description?: string;
|
|
145
|
+
/** The values the source restricts the field to: a QGIS ValueMap widget or an ArcGIS coded-value domain. */
|
|
146
|
+
values?: TableColumnValue[];
|
|
147
|
+
/** Declares that the column holds a file's path rather than a value of its own. */
|
|
148
|
+
'quac:attachment'?: TableColumnAttachment;
|
|
149
|
+
/** Declares that the column's choices are the records of another Collection of the same catalogue. */
|
|
150
|
+
'quac:value_relation'?: TableColumnValueRelation;
|
|
151
|
+
/** Written only as `false`: the source shows the column but does not let anyone change it. */
|
|
152
|
+
'quac:editable'?: false;
|
|
153
|
+
/** A value the column is filled with on its own. */
|
|
154
|
+
'quac:default'?: TableColumnDefault;
|
|
155
|
+
/** The constraints the source checks a value against before it saves. */
|
|
156
|
+
'quac:constraints'?: TableColumnConstraints;
|
|
157
|
+
/** Written only as `true`: the source's form never shows the column. */
|
|
158
|
+
'quac:hidden'?: true;
|
|
159
|
+
/** Written only as `true`: a new feature is offered the value last entered in the column. */
|
|
160
|
+
'quac:reuse_last_value'?: true;
|
|
161
|
+
/**
|
|
162
|
+
* Written only when the column does not pass its value on to a duplicate of
|
|
163
|
+
* a feature: `default` takes the column's default value, or stays blank where
|
|
164
|
+
* it has none; `unset` clears it.
|
|
165
|
+
*/
|
|
166
|
+
'quac:duplicate_policy'?: 'default' | 'unset';
|
|
167
|
+
/** Declares that the column is a Checkbox: a yes/no field with the source's own spelling. */
|
|
168
|
+
'quac:checkbox'?: TableColumnCheckbox;
|
|
169
|
+
/** The limits and number format of a number column, each member written only where the source sets it. */
|
|
170
|
+
'quac:range'?: TableColumnRange;
|
|
171
|
+
/**
|
|
172
|
+
* Written only for a text column that holds dates in a format other than
|
|
173
|
+
* ISO 8601: a QGIS date pattern such as `dd/MM/yyyy`.
|
|
174
|
+
*/
|
|
175
|
+
'quac:date_format'?: string;
|
|
176
|
+
/**
|
|
177
|
+
* The QGIS expressions that decide whether the source's form shows the
|
|
178
|
+
* column, outermost container first. Written only for a column inside
|
|
179
|
+
* containers with an enabled visibility expression.
|
|
180
|
+
*/
|
|
181
|
+
'quac:visible_when'?: string[];
|
|
182
|
+
/** Written only as `false`: the source's form layout does not place the column. */
|
|
183
|
+
'quac:in_form'?: false;
|
|
184
|
+
/** Written only as `true`: the column holds a colour. */
|
|
185
|
+
'quac:color'?: true;
|
|
186
|
+
/**
|
|
187
|
+
* A QGIS expression: the source's form locks the column while it comes out
|
|
188
|
+
* false. Written only for a placed column in a Drag and Drop Designer form
|
|
189
|
+
* with an active data-defined Editable property.
|
|
190
|
+
*/
|
|
191
|
+
'quac:editable_when'?: string;
|
|
192
|
+
/** The `https://` address of the icon drawn beside the column's name. */
|
|
193
|
+
'quac:icon'?: string;
|
|
194
|
+
/** The control the source asks the edit form to draw the column's choices with. */
|
|
195
|
+
'quac:control'?: 'buttons' | 'dropdown';
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* A column whose choices come from another Collection's records: `key` is the
|
|
199
|
+
* lookup field stored in the column, and `value` the one shown for it. Every
|
|
200
|
+
* other member is written only where it differs from the source's default, so
|
|
201
|
+
* a list ordered by key, unfiltered, with no blank choice and one selection
|
|
202
|
+
* carries just the first three.
|
|
203
|
+
*/
|
|
204
|
+
export interface TableColumnValueRelation {
|
|
205
|
+
/** The id of the Collection holding the lookup records. */
|
|
206
|
+
collection: string;
|
|
207
|
+
/** The lookup field whose value the column stores. */
|
|
208
|
+
key: string;
|
|
209
|
+
/** The lookup field whose value is shown for a stored key. */
|
|
210
|
+
value: string;
|
|
211
|
+
/** A QGIS expression narrowing the list. */
|
|
212
|
+
filter?: string;
|
|
213
|
+
/** Written only as `true`: the list offers a blank choice. */
|
|
214
|
+
allow_null?: true;
|
|
215
|
+
/** Written only as `true`: the column stores several keys. */
|
|
216
|
+
allow_multi?: true;
|
|
217
|
+
/** What orders the list when it is not the key: the shown value, or the lookup field named in `order_field`. */
|
|
218
|
+
order_by?: 'value' | 'field';
|
|
219
|
+
/** The lookup field the list is ordered by, written with `order_by` `field`. */
|
|
220
|
+
order_field?: string;
|
|
221
|
+
/** Written only as `true`: the order is reversed. */
|
|
222
|
+
descending?: true;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* A Checkbox column. Every member is written only where it differs from the
|
|
226
|
+
* source's default, so `{}` is a checkbox with no states that allows no blank.
|
|
227
|
+
*/
|
|
228
|
+
export interface TableColumnCheckbox {
|
|
229
|
+
/** The value a text column holds for ticked. */
|
|
230
|
+
checked?: string;
|
|
231
|
+
/** The value a text column holds for unticked. */
|
|
232
|
+
unchecked?: string;
|
|
233
|
+
/** Written only as `true`: the source shows the stored value rather than true and false. */
|
|
234
|
+
show_stored?: true;
|
|
235
|
+
/** Written only as `true`: a blank is a third state. */
|
|
236
|
+
allow_null?: true;
|
|
237
|
+
}
|
|
238
|
+
/** A number column's limits and format. */
|
|
239
|
+
export interface TableColumnRange {
|
|
240
|
+
min?: number;
|
|
241
|
+
max?: number;
|
|
242
|
+
step?: number;
|
|
243
|
+
/** Decimal places shown. */
|
|
244
|
+
precision?: number;
|
|
245
|
+
/** Text shown after the number in the edit form. */
|
|
246
|
+
suffix?: string;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* A column's default value. `now` is the moment of the create or save, written
|
|
250
|
+
* as the column's type holds it; `uuid` is a new random identifier written in
|
|
251
|
+
* `format`; `fixed` is `value`; `expression` is a QGIS expression over the
|
|
252
|
+
* feature's fields. `on_update` fills it on every save rather than only the
|
|
253
|
+
* one creating the feature.
|
|
254
|
+
*/
|
|
255
|
+
export type TableColumnDefault = {
|
|
256
|
+
kind: 'now';
|
|
257
|
+
on_update: boolean;
|
|
258
|
+
} | {
|
|
259
|
+
kind: 'uuid';
|
|
260
|
+
format: 'with_braces' | 'without_braces' | 'id128';
|
|
261
|
+
on_update: boolean;
|
|
262
|
+
} | {
|
|
263
|
+
kind: 'fixed';
|
|
264
|
+
value: string | number | boolean | null;
|
|
265
|
+
on_update: boolean;
|
|
266
|
+
} | {
|
|
267
|
+
kind: 'expression';
|
|
268
|
+
expression: string;
|
|
269
|
+
on_update: boolean;
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* A column's constraints. `not_null` is `enforced` where a blank is refused
|
|
273
|
+
* and `warn` where it saves with a warning; `unique` is `enforced` where a
|
|
274
|
+
* value another feature holds is refused and `warn` where it saves with a
|
|
275
|
+
* warning. `expression` is a QGIS expression over the feature's fields that must
|
|
276
|
+
* be true, in `strength`'s terms; `description` is the message the source
|
|
277
|
+
* gives for it.
|
|
278
|
+
*/
|
|
279
|
+
export interface TableColumnConstraints {
|
|
280
|
+
not_null?: 'enforced' | 'warn';
|
|
281
|
+
unique?: 'enforced' | 'warn';
|
|
282
|
+
expression?: {
|
|
283
|
+
expression: string;
|
|
284
|
+
description?: string;
|
|
285
|
+
strength: 'enforced' | 'warn';
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
/** The column types Groundwork's adapters map a source's declared field types to. */
|
|
289
|
+
export type TableColumnType = 'string' | 'int' | 'long' | 'double' | 'boolean' | 'date' | 'time' | 'timestamp';
|
|
290
|
+
/**
|
|
291
|
+
* The STAC common metadata data types a `TableColumnType` maps to. STAC names
|
|
292
|
+
* only numeric types and gives `other` for the rest, such as text, booleans
|
|
293
|
+
* and dates.
|
|
294
|
+
*/
|
|
295
|
+
export type TableColumnDataType = 'int32' | 'int64' | 'float64' | 'other';
|
|
296
|
+
/**
|
|
297
|
+
* One entry of a `table:columns` picklist — a display label and the value it
|
|
298
|
+
* stores, as the source stores it. An ArcGIS domain can store a number.
|
|
299
|
+
*/
|
|
300
|
+
export interface TableColumnValue {
|
|
301
|
+
value: string | number;
|
|
302
|
+
label: string;
|
|
303
|
+
/**
|
|
304
|
+
* The `https://` address of the value's icon, from the `icon` column of a
|
|
305
|
+
* Value Relation's lookup. Filled only on the copy of a Collection a layer is
|
|
306
|
+
* built from (`withValueRelationLists`); a catalogue never carries it.
|
|
307
|
+
*/
|
|
308
|
+
icon?: string;
|
|
309
|
+
}
|
|
310
|
+
/** A column whose value is a path to a file. An absent member means the source declared nothing. */
|
|
311
|
+
export interface TableColumnAttachment {
|
|
312
|
+
/** How the file is meant to be shown. Absent where the source specifies no viewer. */
|
|
313
|
+
viewer?: 'image' | 'web' | 'audio' | 'video';
|
|
314
|
+
/** The file types the source supports, in the source's own wording. */
|
|
315
|
+
filter?: string;
|
|
316
|
+
/** The folder the source declares the files live in. */
|
|
317
|
+
default_root?: string;
|
|
318
|
+
/** What a stored path is relative to. */
|
|
319
|
+
relative_storage: 'absolute' | 'project' | 'default-root';
|
|
320
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal STAC type definitions for the documents Groundwork generates.
|
|
3
|
+
*
|
|
4
|
+
* The shape these types describe — a Catalog of Collections, one Collection
|
|
5
|
+
* per layer, vendor fields under `quac:` —
|
|
6
|
+
* is written up in `packages/quac/spec/README.md`.
|
|
7
|
+
*
|
|
8
|
+
* STAC core (Item / Catalog / Collection) is an OGC Community Standard since
|
|
9
|
+
* Oct 2025. We model only the subset we emit — extension fields and unused
|
|
10
|
+
* core fields are reachable via the index signature.
|
|
11
|
+
*
|
|
12
|
+
* If validation needs grow beyond structural assertions, swap to a typed
|
|
13
|
+
* STAC library (e.g. stac-js or @radiantearth/stac-spec-typescript). For
|
|
14
|
+
* Phase 5 the inline types keep the dep tree small.
|
|
15
|
+
*/
|
|
16
|
+
export const STAC_VERSION = '1.1.0';
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { LayerScaleRange } from './QgsProject.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Typed in-memory representation of a QGIS Server WMS GetProjectSettings
|
|
4
|
+
* response. Parallel to QgsProject (parsed from a static .qgs file) but
|
|
5
|
+
* sourced from the live server XML — Phase 8's QgisServerAdapter projects
|
|
6
|
+
* this into the same STAC catalogue shape a parsed .qgs file produces.
|
|
7
|
+
*
|
|
8
|
+
* GetProjectSettings is QGIS Server's WMS extension that bundles much of
|
|
9
|
+
* what we need: layer tree, bbox, full attribute schema, named styles,
|
|
10
|
+
* displayField, visibility, queryable / mutuallyExclusive flags. It does
|
|
11
|
+
* NOT include: form layouts or per-style XML (use GetStyles separately for
|
|
12
|
+
* that). Field aliases are captured when the server exposes them.
|
|
13
|
+
*/
|
|
14
|
+
export interface WmsProject {
|
|
15
|
+
/** Project title from <Service><Title>; "" if not declared. */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Project-level KeywordList (often signals 'export=true' for QGIS Server). */
|
|
18
|
+
keywords: string[];
|
|
19
|
+
/** WGS84 bounding box of the root layer container; null if not declared. */
|
|
20
|
+
bbox: WmsBoundingBox | null;
|
|
21
|
+
/** Layer tree mirrored from the nested <Layer> structure. */
|
|
22
|
+
layerTree: WmsLayerTreeNode[];
|
|
23
|
+
/** Names of layers exposed via WFS (subset of the layer tree). */
|
|
24
|
+
wfsLayerNames: string[];
|
|
25
|
+
/** Full source XML, retained so future enhancements can re-mine. */
|
|
26
|
+
rawXml: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface WmsBoundingBox {
|
|
29
|
+
westBoundLongitude: number;
|
|
30
|
+
eastBoundLongitude: number;
|
|
31
|
+
southBoundLatitude: number;
|
|
32
|
+
northBoundLatitude: number;
|
|
33
|
+
}
|
|
34
|
+
/** A node in the WMS layer tree — either a group container or a leaf data layer. */
|
|
35
|
+
export type WmsLayerTreeNode = WmsLayerGroup | WmsLayer;
|
|
36
|
+
export interface WmsLayerGroup {
|
|
37
|
+
kind: 'group';
|
|
38
|
+
/** Internal name; may be empty for the root container. */
|
|
39
|
+
name: string;
|
|
40
|
+
title: string;
|
|
41
|
+
/** When true, only one child can be visible at a time (radio-style). */
|
|
42
|
+
mutuallyExclusive: boolean;
|
|
43
|
+
/** Whether the group is checked in the layer tree. */
|
|
44
|
+
visibilityChecked: boolean;
|
|
45
|
+
bbox: WmsBoundingBox | null;
|
|
46
|
+
treeName: string;
|
|
47
|
+
children: WmsLayerTreeNode[];
|
|
48
|
+
}
|
|
49
|
+
export interface WmsLayer {
|
|
50
|
+
kind: 'layer';
|
|
51
|
+
/** Internal layer name (used as the WFS typeName). */
|
|
52
|
+
name: string;
|
|
53
|
+
/** Human-readable title. */
|
|
54
|
+
title: string;
|
|
55
|
+
/** Field nominated as the layer's display attribute (its title field). */
|
|
56
|
+
displayField: string | null;
|
|
57
|
+
/** Geometry type as QGIS Server writes it: a WKB type name, such as `MultiPolygon`. */
|
|
58
|
+
geometryType: string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the layer is queryable for GetFeatureInfo. QGIS Server writes it
|
|
61
|
+
* from the layer's Identifiable flag (`qgswmslayerinfos.cpp`, `qgis/QGIS@master`,
|
|
62
|
+
* read 2026-10-19), and a layer that states nothing counts as queryable.
|
|
63
|
+
*/
|
|
64
|
+
queryable: boolean;
|
|
65
|
+
/** Whether the layer is checked in the QGIS layer tree by default. */
|
|
66
|
+
visibilityChecked: boolean;
|
|
67
|
+
/** Layer opacity 0..1. */
|
|
68
|
+
opacity: number;
|
|
69
|
+
/** WGS84 bbox. */
|
|
70
|
+
bbox: WmsBoundingBox | null;
|
|
71
|
+
/** The scales the layer is drawn between, as the QGIS project sets them; null where it sets none. */
|
|
72
|
+
scaleRange: LayerScaleRange | null;
|
|
73
|
+
/** CRSes the layer can be requested in. */
|
|
74
|
+
crsList: string[];
|
|
75
|
+
/** Named styles ("default", "Asset Owner", "Priority" etc.). */
|
|
76
|
+
styles: WmsStyle[];
|
|
77
|
+
/** Attribute schema (vector layers; empty for raster). */
|
|
78
|
+
attributes: WmsAttribute[];
|
|
79
|
+
/** Display name in the layer panel. */
|
|
80
|
+
treeName: string;
|
|
81
|
+
}
|
|
82
|
+
export interface WmsStyle {
|
|
83
|
+
/** Internal style name (e.g. "default"). */
|
|
84
|
+
name: string;
|
|
85
|
+
/** Human-readable title. */
|
|
86
|
+
title: string;
|
|
87
|
+
}
|
|
88
|
+
export interface WmsAttribute {
|
|
89
|
+
/** Field name. */
|
|
90
|
+
name: string;
|
|
91
|
+
/** QGIS field alias, when GetProjectSettings exposes one. */
|
|
92
|
+
alias: string | null;
|
|
93
|
+
/** Qt type (e.g. "QString", "int", "double", "bool", "QDateTime"). */
|
|
94
|
+
type: string;
|
|
95
|
+
/** Human-readable type name (e.g. "String", "Integer", "DateTime"). */
|
|
96
|
+
typeName: string;
|
|
97
|
+
/** Maximum length for string fields; 0 for unbounded or non-string. */
|
|
98
|
+
length: number;
|
|
99
|
+
/** Decimal precision for numeric fields; 0 for non-numeric. */
|
|
100
|
+
precision: number;
|
|
101
|
+
/** Editor widget hint from QGIS (e.g. "TextEdit", "Range", "DateTime", "CheckBox"). */
|
|
102
|
+
editType: string;
|
|
103
|
+
/** Optional comment / description from QGIS. */
|
|
104
|
+
comment: string;
|
|
105
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/** Where a layer's features are read from: its FeatureServer layer, through the service's own query. */
|
|
2
|
+
export interface ArcgisLayerSource {
|
|
3
|
+
layerUrl: string;
|
|
4
|
+
/** The Web Map's filter on the layer, in ArcGIS's SQL. Null where it sets none. */
|
|
5
|
+
where: string | null;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Why a layer is left out.
|
|
9
|
+
*
|
|
10
|
+
* - `not-queryable`: the layer's service does not answer queries as GeoJSON.
|
|
11
|
+
* - `not-a-feature-layer`: the layer is not a FeatureServer feature layer.
|
|
12
|
+
* - `layer-unavailable`: the layer's service could not be read.
|
|
13
|
+
*/
|
|
14
|
+
export type ArcgisNotShownReason = 'not-queryable' | 'not-a-feature-layer' | 'layer-unavailable';
|
|
15
|
+
interface ArcgisLayerBase {
|
|
16
|
+
/** The Web Map's own layer id. A layer from no Web Map has `{itemId}_{layerIndex}`, or `{serviceUrl}_{layerIndex}` where the service names no item. */
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
/** False only where the Web Map says so; a layer with no setting is visible. */
|
|
20
|
+
visible: boolean;
|
|
21
|
+
/** 0 to 1. */
|
|
22
|
+
opacity: number;
|
|
23
|
+
/** ArcGIS scale denominators. Null where the layer has no limit. */
|
|
24
|
+
minScale: number | null;
|
|
25
|
+
maxScale: number | null;
|
|
26
|
+
/** The layer's FeatureServer URL, or null for a layer that has none. */
|
|
27
|
+
layerUrl: string | null;
|
|
28
|
+
itemId: string | null;
|
|
29
|
+
}
|
|
30
|
+
export interface ArcgisFieldMetadata {
|
|
31
|
+
displayField: string | null;
|
|
32
|
+
/** In the service's declared order. */
|
|
33
|
+
fields: ArcgisField[];
|
|
34
|
+
}
|
|
35
|
+
/** One field a FeatureServer layer declares, as the service declares it. */
|
|
36
|
+
export interface ArcgisField {
|
|
37
|
+
name: string;
|
|
38
|
+
/** Null where the service gives no non-blank alias. */
|
|
39
|
+
alias: string | null;
|
|
40
|
+
/** The service's own type name, such as `esriFieldTypeInteger`. Null where it gives none. */
|
|
41
|
+
type: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* The field's coded-value domain. Null where the field has none, and where a
|
|
44
|
+
* subtype gives the field a domain other than the field's own.
|
|
45
|
+
*/
|
|
46
|
+
codedValues: ArcgisCodedValue[] | null;
|
|
47
|
+
/**
|
|
48
|
+
* The field's range domain. Null where the field has none, where a subtype
|
|
49
|
+
* gives the field a domain other than the field's own, and where the
|
|
50
|
+
* service's range is not two finite numbers.
|
|
51
|
+
*/
|
|
52
|
+
range?: ArcgisRange | null;
|
|
53
|
+
}
|
|
54
|
+
/** A range domain's limits, both ends included. */
|
|
55
|
+
export interface ArcgisRange {
|
|
56
|
+
min: number;
|
|
57
|
+
max: number;
|
|
58
|
+
}
|
|
59
|
+
/** One entry of a coded-value domain: the code the field stores, and its name. */
|
|
60
|
+
export interface ArcgisCodedValue {
|
|
61
|
+
code: string | number;
|
|
62
|
+
name: string;
|
|
63
|
+
}
|
|
64
|
+
/** A box in the coordinates of the CRS it names. */
|
|
65
|
+
export interface ArcgisExtent {
|
|
66
|
+
xmin: number;
|
|
67
|
+
ymin: number;
|
|
68
|
+
xmax: number;
|
|
69
|
+
ymax: number;
|
|
70
|
+
/** `EPSG:<code>`, from the spatial reference's `latestWkid`, else its `wkid`. */
|
|
71
|
+
crs: string;
|
|
72
|
+
}
|
|
73
|
+
export type ArcgisResolvedLayer = (ArcgisLayerBase & {
|
|
74
|
+
status: 'shown';
|
|
75
|
+
metadata?: ArcgisFieldMetadata;
|
|
76
|
+
/** The service's own geometry type name, such as `esriGeometryPolygon`. Null where it gives none. */
|
|
77
|
+
geometryType?: string | null;
|
|
78
|
+
/** Null where the service gives no extent, or one with no numeric spatial reference. */
|
|
79
|
+
extent?: ArcgisExtent | null;
|
|
80
|
+
/** The service layer's description, else the layer's item's summary and description, as text. Null where none says. */
|
|
81
|
+
description?: string | null;
|
|
82
|
+
/** The layer's item's tags; empty where it has no item or its item cannot be read. */
|
|
83
|
+
keywords?: string[];
|
|
84
|
+
/** The layer's copyright text, else the layer's item's credits. Null where neither says. */
|
|
85
|
+
credit?: string | null;
|
|
86
|
+
/** The layer's item's licence text, as text. Null where it gives none. */
|
|
87
|
+
license?: string | null;
|
|
88
|
+
/** When the layer's item was created, as an ISO 8601 UTC time. Null where it does not say. */
|
|
89
|
+
created?: string | null;
|
|
90
|
+
/** When the layer's item was last modified, as an ISO 8601 UTC time. Null where it does not say. */
|
|
91
|
+
updated?: string | null;
|
|
92
|
+
/** When the layer's data was last edited, else the layer, as an ISO 8601 UTC time. Null where neither says. */
|
|
93
|
+
dataUpdated?: string | null;
|
|
94
|
+
source: ArcgisLayerSource;
|
|
95
|
+
/**
|
|
96
|
+
* Where the layer's style is read from: the Web Map's own style for the
|
|
97
|
+
* layer where the map sets one, otherwise the FeatureServer layer's. Null
|
|
98
|
+
* where neither has a renderer.
|
|
99
|
+
*/
|
|
100
|
+
styleHref: string | null;
|
|
101
|
+
}) | (ArcgisLayerBase & {
|
|
102
|
+
status: 'not-shown';
|
|
103
|
+
reason: ArcgisNotShownReason;
|
|
104
|
+
});
|
|
105
|
+
/** A Web Map, Feature Service item, Hub dataset or FeatureServer URL, read down to its layers. */
|
|
106
|
+
export interface ArcgisLayerSet {
|
|
107
|
+
kind: 'layers';
|
|
108
|
+
title: string;
|
|
109
|
+
/** The Web Map's or Feature Service's item id. Null for a FeatureServer that reports none. */
|
|
110
|
+
itemId: string | null;
|
|
111
|
+
itemType: 'Web Map' | 'Feature Service';
|
|
112
|
+
layers: ArcgisResolvedLayer[];
|
|
113
|
+
/**
|
|
114
|
+
* The box a Web Map was saved showing: its `initialState.viewpoint.targetGeometry`.
|
|
115
|
+
* Null for a Feature Service, and for a Web Map that saves none, or one with
|
|
116
|
+
* no numeric spatial reference.
|
|
117
|
+
*/
|
|
118
|
+
initialView: ArcgisExtent | null;
|
|
119
|
+
/** The item's short summary, as text. Null where it gives none, or names no item. */
|
|
120
|
+
summary: string | null;
|
|
121
|
+
}
|
|
122
|
+
/** A pasted OGC API or WFS URL, which goes to the existing source for it unchanged. */
|
|
123
|
+
export interface ArcgisPassthrough {
|
|
124
|
+
kind: 'passthrough';
|
|
125
|
+
source: {
|
|
126
|
+
kind: 'ogcapi';
|
|
127
|
+
url: string;
|
|
128
|
+
} | {
|
|
129
|
+
kind: 'wfs';
|
|
130
|
+
endpoint: string;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export type ArcgisResolution = ArcgisLayerSet | ArcgisPassthrough;
|
|
134
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { StacCollection } from './Stac.ts';
|
|
2
|
+
/**
|
|
3
|
+
* How a QGIS Delimited Text data source splits its file, and the catalogue
|
|
4
|
+
* field that carries it.
|
|
5
|
+
*
|
|
6
|
+
* QGIS reads a CSV with its Delimited Text provider when it is added from the
|
|
7
|
+
* Data Source Manager's Delimited Text tab, and with OGR when it is dragged
|
|
8
|
+
* into the project. Only the first names its options, and only the first
|
|
9
|
+
* cannot edit (`QgsDelimitedTextProvider::capabilities`,
|
|
10
|
+
* `src/providers/delimitedtext/qgsdelimitedtextprovider.cpp`,
|
|
11
|
+
* `qgis/QGIS@99f68421`, read 2026-10-24).
|
|
12
|
+
*/
|
|
13
|
+
export interface DelimitedTextOptions {
|
|
14
|
+
/** Characters that each end a cell. */
|
|
15
|
+
delimiter: string;
|
|
16
|
+
/** Characters that each open and close a quoted cell. */
|
|
17
|
+
quote: string;
|
|
18
|
+
/** Characters that each make the next character literal. A quote character here escapes only itself. */
|
|
19
|
+
escape: string;
|
|
20
|
+
/** Lines skipped before the header or the first row. */
|
|
21
|
+
skipLines: number;
|
|
22
|
+
/** Whether the first row read holds the column names. */
|
|
23
|
+
header: boolean;
|
|
24
|
+
/** Whether space around an unquoted cell is removed. */
|
|
25
|
+
trim: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** QGIS's defaults for a Delimited Text source that names nothing (`QgsDelimitedTextFile::setFromUrl`). */
|
|
28
|
+
export declare const DEFAULT_DELIMITED_TEXT_OPTIONS: DelimitedTextOptions;
|
|
29
|
+
/** The key a data asset takes for the options of a Delimited Text source. */
|
|
30
|
+
export declare const QUAC_DELIMITED_TEXT = "quac:delimited_text";
|
|
31
|
+
/** The field as the catalogue writes it. */
|
|
32
|
+
export declare function delimitedTextField(options: DelimitedTextOptions): Record<string, unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* A Collection's Delimited Text options, or null where its data asset names
|
|
35
|
+
* none, which is a file QGIS reads with OGR or no CSV at all. A key the field
|
|
36
|
+
* leaves out takes QGIS's default, and a field with no delimiter is no field.
|
|
37
|
+
*/
|
|
38
|
+
export declare function readCollectionDelimitedText(collection: StacCollection): DelimitedTextOptions | null;
|