@vectoriahq/quac 0.0.0-stage → 0.2.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 +143 -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 +452 -0
- package/dist/generate/normalizedProject.js +877 -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 +887 -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 +229 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.js +52 -0
- package/dist/model/QgsProject.d.ts +724 -0
- package/dist/model/QgsProject.js +15 -0
- package/dist/model/Stac.d.ts +322 -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 +1125 -0
- package/dist/parse/parseLegendTree.d.ts +20 -0
- package/dist/parse/parseLegendTree.js +66 -0
- package/dist/parse/parseMeasurement.d.ts +20 -0
- package/dist/parse/parseMeasurement.js +66 -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 +10 -0
- package/dist/util/devLog.js +22 -0
- package/dist/util/fileName.d.ts +18 -0
- package/dist/util/fileName.js +45 -0
- package/dist/util/nonBlankText.d.ts +2 -0
- package/dist/util/nonBlankText.js +4 -0
- package/dist/util/wfsVersions.d.ts +9 -0
- package/dist/util/wfsVersions.js +13 -0
- package/package.json +55 -4
- package/src/schema/quac.schema.json +939 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import type { LayerLocks, FieldAttachment, FieldEditRule, LayerFormLayout, LayerScaleRange, ProjectMeasurement } from '../model/QgsProject.ts';
|
|
2
|
+
import type { StacAsset, StacCatalog, StacCollection, StacExtent, StacLink, StacProvider, TableColumn, TableColumnValue, TableColumnValueRelation } from '../model/Stac.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Source-agnostic intermediate model + the single STAC generator that
|
|
5
|
+
* consumes it.
|
|
6
|
+
*
|
|
7
|
+
* Both source pipelines — the static `.qgs` path (QgsProject) and the live
|
|
8
|
+
* QGIS Server path (WmsProject) — project their model into a
|
|
9
|
+
* `NormalizedProject`, then hand it to `generateStacFromNormalized`. All the
|
|
10
|
+
* shared tree-walk / catalog / collection / link assembly is here once;
|
|
11
|
+
* the per-source wording, id fallbacks, bbox field names, `table:columns`
|
|
12
|
+
* derivation and asset shapes are resolved by the source adapters *before*
|
|
13
|
+
* they build the normalized tree, so this core has no source
|
|
14
|
+
* conditionals.
|
|
15
|
+
*
|
|
16
|
+
* This is the convergence point for the STAC data-model direction: new
|
|
17
|
+
* source types only need a `*ToNormalized` adapter, not a fresh generator.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* STAC extension URL for the Table extension. Pinned to the version we wrote
|
|
21
|
+
* against — changes here imply schema review since the extension is still
|
|
22
|
+
* maturing.
|
|
23
|
+
*/
|
|
24
|
+
export declare const TABLE_EXTENSION = "https://stac-extensions.github.io/table/v1.3.0/schema.json";
|
|
25
|
+
/** STAC extension URL for the Vector extension, whose `vector:geometry_types` a Collection carries. */
|
|
26
|
+
export declare const VECTOR_EXTENSION = "https://stac-extensions.github.io/vector/v0.1.0/schema.json";
|
|
27
|
+
/**
|
|
28
|
+
* The key a Collection takes for the relations that make it a related dataset
|
|
29
|
+
* rather than a map layer (`packages/quac/spec/README.md`). Its value is
|
|
30
|
+
* an array, because one set of records can hang off more than one parent.
|
|
31
|
+
*/
|
|
32
|
+
export declare const QUAC_RELATED_TO_FIELD = "quac:related_to";
|
|
33
|
+
/**
|
|
34
|
+
* The key a Collection takes when its source keeps it out of the legend: a QGIS
|
|
35
|
+
* layer's Private flag (`packages/quac/spec/README.md`). Written only as
|
|
36
|
+
* `true`.
|
|
37
|
+
*/
|
|
38
|
+
export declare const QUAC_PRIVATE_FIELD = "quac:private";
|
|
39
|
+
/**
|
|
40
|
+
* The key a Collection takes for the edits its source locks: `{ add?,
|
|
41
|
+
* attributes?, geometry?, delete? }`, each `true` or `{ expression }`. Written
|
|
42
|
+
* only where the source locks an edit.
|
|
43
|
+
*/
|
|
44
|
+
export declare const QUAC_LOCKS_FIELD = "quac:locks";
|
|
45
|
+
/**
|
|
46
|
+
* The key a Collection takes for the filters its source sets up: a list of
|
|
47
|
+
* `{ field, name? }`, in the source's order. Written only where it sets one.
|
|
48
|
+
*/
|
|
49
|
+
export declare const QUAC_FILTERS_FIELD = "quac:filters";
|
|
50
|
+
export declare const QUAC_LEGEND_IMAGE_FIELD = "quac:legend_image";
|
|
51
|
+
/**
|
|
52
|
+
* The key a Collection takes for the icon drawn beside its name: an `https://`
|
|
53
|
+
* address, the same form as a column's `quac:icon`.
|
|
54
|
+
*/
|
|
55
|
+
export declare const QUAC_ICON_FIELD = "quac:icon";
|
|
56
|
+
/**
|
|
57
|
+
* The key a Collection takes for the area and distance units its source gives
|
|
58
|
+
* `$area`, `$length` and `$perimeter` in: `{ area_unit, distance_unit }`, each
|
|
59
|
+
* the name QGIS saves.
|
|
60
|
+
*/
|
|
61
|
+
export declare const QUAC_MEASUREMENT_FIELD = "quac:measurement";
|
|
62
|
+
/**
|
|
63
|
+
* The key a Collection takes for the fields its source's form layout places, in
|
|
64
|
+
* the layout's order: a QGIS Drag and Drop Designer form
|
|
65
|
+
* (`packages/quac/spec/README.md`). A Collection whose source has no such layout has no such field.
|
|
66
|
+
*/
|
|
67
|
+
export declare const QUAC_FORM_ORDER_FIELD = "quac:form_order";
|
|
68
|
+
/**
|
|
69
|
+
* The key a group Catalog takes when its source shows only one of its children
|
|
70
|
+
* at a time: a QGIS mutually exclusive group. Written only when true.
|
|
71
|
+
*/
|
|
72
|
+
export declare const QUAC_MUTUALLY_EXCLUSIVE_FIELD = "quac:mutually_exclusive";
|
|
73
|
+
/**
|
|
74
|
+
* The key a top-level Catalog takes for the id of the Collection its source
|
|
75
|
+
* names as the one the map opens with as the active layer.
|
|
76
|
+
*/
|
|
77
|
+
export declare const QUAC_ACTIVE_COLLECTION_FIELD = "quac:active_collection";
|
|
78
|
+
/**
|
|
79
|
+
* One relation a Collection declares in `quac:related_to`: the parent
|
|
80
|
+
* Collection its records hang off, the field pair(s) joining them, and the name
|
|
81
|
+
* the relation is shown under.
|
|
82
|
+
*/
|
|
83
|
+
export interface CollectionRelation {
|
|
84
|
+
/** The relation's id within its catalogue. */
|
|
85
|
+
id: string;
|
|
86
|
+
/** Display name for the relation; empty when the source declares none. */
|
|
87
|
+
name: string;
|
|
88
|
+
/** Id of the Collection holding the parent records. */
|
|
89
|
+
parentCollectionId: string;
|
|
90
|
+
/** The field pairs joining this Collection to the parent. Several make one composite key. */
|
|
91
|
+
fields: CollectionRelationField[];
|
|
92
|
+
}
|
|
93
|
+
/** One field on each side of a relation's join. */
|
|
94
|
+
export interface CollectionRelationField {
|
|
95
|
+
/** Field name on the parent Collection. */
|
|
96
|
+
parent: string;
|
|
97
|
+
/** Field name on the Collection holding the relation. */
|
|
98
|
+
child: string;
|
|
99
|
+
}
|
|
100
|
+
/** Bounding box in WGS84, CRS-free — the shape both source bboxes normalise to. */
|
|
101
|
+
export interface NormalizedBbox {
|
|
102
|
+
xmin: number;
|
|
103
|
+
ymin: number;
|
|
104
|
+
xmax: number;
|
|
105
|
+
ymax: number;
|
|
106
|
+
}
|
|
107
|
+
/** A node in the normalized tree — either a group container or a leaf layer. */
|
|
108
|
+
export type NormalizedNode = NormalizedGroup | NormalizedLayer;
|
|
109
|
+
export interface NormalizedGroup {
|
|
110
|
+
kind: 'group';
|
|
111
|
+
/** Slugified catalog id — the adapter has already applied any 'group' fallback. */
|
|
112
|
+
id: string;
|
|
113
|
+
/**
|
|
114
|
+
* Raw group title (may be empty). The generator uses `title || undefined`
|
|
115
|
+
* for the catalog's `title`, and the raw value for the child link's title —
|
|
116
|
+
* matching the two source pipelines' original behaviour.
|
|
117
|
+
*/
|
|
118
|
+
title: string;
|
|
119
|
+
/** Fully-built catalog description (source-specific wording resolved by the adapter). */
|
|
120
|
+
description: string;
|
|
121
|
+
/** True when the source shows only one of its children at a time. */
|
|
122
|
+
mutuallyExclusive?: boolean;
|
|
123
|
+
children: NormalizedNode[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The names QGIS Server gives a layer: its WMS layer name, and its WFS type
|
|
127
|
+
* name where the project publishes it for WFS. Null where the route does not
|
|
128
|
+
* know a name.
|
|
129
|
+
*/
|
|
130
|
+
export interface QgisServerNames {
|
|
131
|
+
wmsName: string | null;
|
|
132
|
+
wfsTypeName: string | null;
|
|
133
|
+
}
|
|
134
|
+
export interface NormalizedLayer {
|
|
135
|
+
kind: 'layer';
|
|
136
|
+
/** Collection id. */
|
|
137
|
+
id: string;
|
|
138
|
+
/** Collection title — also used verbatim as the child link's title. */
|
|
139
|
+
title: string;
|
|
140
|
+
/** Fully-built collection description. */
|
|
141
|
+
description: string;
|
|
142
|
+
/** WGS84 bbox; null falls back to the world extent in `buildStacExtent`. */
|
|
143
|
+
bbox: NormalizedBbox | null;
|
|
144
|
+
/** The geometry type as QGIS names it, written as `quac:geometry_type`. */
|
|
145
|
+
geometryType: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* The WKB type names the layer's features take, such as `MultiPolygon` or
|
|
148
|
+
* `PointZ`: one for most layers, one per shape for a file the project splits
|
|
149
|
+
* into a layer per shape. Written as `vector:geometry_types` where each is a
|
|
150
|
+
* GeoJSON type. Empty or absent where the source does not give them.
|
|
151
|
+
*/
|
|
152
|
+
wkbTypes?: readonly string[];
|
|
153
|
+
/** The names QGIS Server gives the layer, written as `quac:qgis_server_wms_name` and `quac:qgis_server_wfs_type_name`. */
|
|
154
|
+
qgisServerNames?: QgisServerNames | null;
|
|
155
|
+
/** Already-derived `table:columns`; empty array omits the Table extension. */
|
|
156
|
+
tableColumns: TableColumn[];
|
|
157
|
+
/** Already-built STAC assets for this layer. */
|
|
158
|
+
assets: Record<string, StacAsset>;
|
|
159
|
+
/** Free-text keywords the source declares; omitted from the Collection when empty. */
|
|
160
|
+
keywords?: string[];
|
|
161
|
+
/** SPDX identifier or free text the source declares; falls back to `'other'` when absent. */
|
|
162
|
+
license?: string | null;
|
|
163
|
+
/** Who produced, licensed or hosts this layer's data, beyond the project-wide defaults. */
|
|
164
|
+
providers?: StacProvider[];
|
|
165
|
+
/** When the source says its description of the layer was created, as an ISO 8601 UTC time; omitted when it does not. */
|
|
166
|
+
created?: string;
|
|
167
|
+
/** When the source says its description of the layer was last changed, as an ISO 8601 UTC time; omitted when it does not. */
|
|
168
|
+
updated?: string;
|
|
169
|
+
/** Temporal range the source declares; falls back to the open interval when absent. */
|
|
170
|
+
temporalInterval?: [string | null, string | null] | null;
|
|
171
|
+
displayField: string | null;
|
|
172
|
+
/**
|
|
173
|
+
* Whether the source has this layer switched on. Records the project author's
|
|
174
|
+
* intent, so a source that declares none of it — a bare WFS service or a
|
|
175
|
+
* folder of files — passes null and the field is left off the
|
|
176
|
+
* Collection entirely.
|
|
177
|
+
*/
|
|
178
|
+
visibilityChecked: boolean | null;
|
|
179
|
+
/**
|
|
180
|
+
* Emits `quac:editable` when non-null. The WMS path passes null because
|
|
181
|
+
* GetProjectSettings doesn't expose readOnly, so it omits the field.
|
|
182
|
+
*/
|
|
183
|
+
editable: boolean | null;
|
|
184
|
+
/**
|
|
185
|
+
* Emits `quac:identifiable` when non-null: false means the layer can be shown on
|
|
186
|
+
* the map but never become the active layer. A source with no such
|
|
187
|
+
* declaration leaves it off.
|
|
188
|
+
*/
|
|
189
|
+
identifiable?: boolean | null;
|
|
190
|
+
/**
|
|
191
|
+
* The scales the source draws the layer between. Emitted as
|
|
192
|
+
* `quac:min_scale` and `quac:max_scale`, each only when it sets a limit.
|
|
193
|
+
*/
|
|
194
|
+
scaleRange?: LayerScaleRange | null;
|
|
195
|
+
/**
|
|
196
|
+
* The opacity the source draws the layer at, from 0 to 1. Emitted as
|
|
197
|
+
* `quac:opacity` when non-null; a source with no author behind it leaves it off.
|
|
198
|
+
*/
|
|
199
|
+
opacity?: number | null;
|
|
200
|
+
/**
|
|
201
|
+
* Relations with this layer as the child. Emitted as
|
|
202
|
+
* `quac:related_to`; a layer with none has no such field.
|
|
203
|
+
*/
|
|
204
|
+
relatedTo?: CollectionRelation[];
|
|
205
|
+
/** Emitted as `quac:private` when true: the source keeps the layer out of its legend. */
|
|
206
|
+
isPrivate?: boolean;
|
|
207
|
+
/** Emitted as `quac:legend_image`: the image the source shows in place of the layer's legend, as a `data:` URL. */
|
|
208
|
+
legendImage?: string | null;
|
|
209
|
+
/** Emitted as `quac:icon`: the `https://` address of the icon drawn beside the layer's name. */
|
|
210
|
+
icon?: string | null;
|
|
211
|
+
/** Emitted as `quac:locks` where it locks an edit. */
|
|
212
|
+
locks?: LayerLocks;
|
|
213
|
+
/** Emitted as `quac:filters` where the source sets one up. */
|
|
214
|
+
filters?: CollectionFilter[];
|
|
215
|
+
/**
|
|
216
|
+
* The names of the fields the source's form layout places, in its order.
|
|
217
|
+
* Emitted as `quac:form_order`; absent for a source with no form layout.
|
|
218
|
+
*/
|
|
219
|
+
formOrder?: string[];
|
|
220
|
+
/**
|
|
221
|
+
* Source-declaring fields copied straight onto the Collection, such as
|
|
222
|
+
* the `quac:wfs_*` keys the profile defines. Omitted keys simply don't appear on the
|
|
223
|
+
* Collection.
|
|
224
|
+
*/
|
|
225
|
+
vendorFields?: Record<string, unknown>;
|
|
226
|
+
links?: StacLink[];
|
|
227
|
+
extensions?: string[];
|
|
228
|
+
}
|
|
229
|
+
export interface NormalizedProject {
|
|
230
|
+
/** Slugified catalog id — adapter has applied any project-level fallback. */
|
|
231
|
+
id: string;
|
|
232
|
+
/** Raw project title; the catalog's `title` becomes `title || undefined`. */
|
|
233
|
+
title: string;
|
|
234
|
+
/** Fully-built top-level catalog description. */
|
|
235
|
+
description: string;
|
|
236
|
+
/** Catalog-level WGS84 bbox, covering the data; null omits the extent entirely. */
|
|
237
|
+
bbox: NormalizedBbox | null;
|
|
238
|
+
/**
|
|
239
|
+
* The WGS84 box the source's author saved the map showing. A different fact
|
|
240
|
+
* from `bbox`; null or absent where the source saves no view.
|
|
241
|
+
*/
|
|
242
|
+
initialView?: NormalizedBbox | null;
|
|
243
|
+
/**
|
|
244
|
+
* The id of the Collection the source names as the map's opening active
|
|
245
|
+
* layer. Written only where the tree holds a Collection with that id; null
|
|
246
|
+
* or absent where the source names none.
|
|
247
|
+
*/
|
|
248
|
+
activeCollectionId?: string | null;
|
|
249
|
+
/** Vendor-namespaced fields copied straight onto the top-level Catalog. */
|
|
250
|
+
vendorFields?: Record<string, unknown>;
|
|
251
|
+
/**
|
|
252
|
+
* Project-wide providers — the project's own author, say — merged onto
|
|
253
|
+
* every Collection the tree produces, alongside whatever that layer
|
|
254
|
+
* declares of its own.
|
|
255
|
+
*/
|
|
256
|
+
providers?: StacProvider[];
|
|
257
|
+
/** Ordered top-level tree (the source root group's children, flattened one level). */
|
|
258
|
+
nodes: NormalizedNode[];
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Records where a catalogue came from as the Catalog's `self` link, so the
|
|
262
|
+
* document says it rather than a reader holding it alongside. Sources with no
|
|
263
|
+
* address of their own leave it off.
|
|
264
|
+
*/
|
|
265
|
+
export declare function withSelfLink(catalogue: StacCatalog, selfHref: string | undefined): StacCatalog;
|
|
266
|
+
/**
|
|
267
|
+
* Builds a STAC Catalog tree from a NormalizedProject, listing the QUAC schema
|
|
268
|
+
* in `stac_extensions` where `declareQuacExtension` says:
|
|
269
|
+
* NormalizedProject → top-level Catalog
|
|
270
|
+
* group nodes → nested Catalogs
|
|
271
|
+
* layer nodes → Collections
|
|
272
|
+
*/
|
|
273
|
+
export declare function generateStacFromNormalized(project: NormalizedProject): StacCatalog;
|
|
274
|
+
/**
|
|
275
|
+
* The column with `data_type` written beside its `type`, as the Table
|
|
276
|
+
* extension recommends. A `type` outside `TableColumnType`, such as a QGIS
|
|
277
|
+
* Server type name this package does not map, gets no `data_type`.
|
|
278
|
+
*/
|
|
279
|
+
export declare function withDataType(column: TableColumn): TableColumn;
|
|
280
|
+
/**
|
|
281
|
+
* Reads `quac:active_collection` back off a Catalog: the id of the Collection
|
|
282
|
+
* the map opens with as the active layer, or null where the source names none.
|
|
283
|
+
*/
|
|
284
|
+
export declare function readCatalogueActiveCollection(catalog: StacCatalog): string | null;
|
|
285
|
+
/**
|
|
286
|
+
* Reads `quac:initial_view` back off a Catalog.
|
|
287
|
+
*
|
|
288
|
+
* Returns null for a Catalog that declares nothing, which is what every source
|
|
289
|
+
* with no saved view behind it publishes. Null means "the source said nothing
|
|
290
|
+
* about where to open", so a caller frames the map its own way rather than
|
|
291
|
+
* reading a missing field as an instruction.
|
|
292
|
+
*/
|
|
293
|
+
export declare function readCatalogueInitialView(catalog: StacCatalog): NormalizedBbox | null;
|
|
294
|
+
/**
|
|
295
|
+
* Reads shared source declarations back off a Collection.
|
|
296
|
+
*
|
|
297
|
+
* Each returns null for a Collection that declares nothing, which is what every
|
|
298
|
+
* source with no author behind it publishes. Null means "the source said
|
|
299
|
+
* nothing", never "the source said no", so a caller supplies its own default
|
|
300
|
+
* rather than reading a missing field as `false`.
|
|
301
|
+
*/
|
|
302
|
+
/** The field the source nominates as the layer's title attribute. */
|
|
303
|
+
export declare function readCollectionDisplayField(collection: StacCollection): string | null;
|
|
304
|
+
/** Field display labels from STAC Table column titles or descriptions. */
|
|
305
|
+
export declare function readCollectionFieldAliases(collection: StacCollection): Record<string, string>;
|
|
306
|
+
/**
|
|
307
|
+
* Every field name a Collection declares, in the order it declares them.
|
|
308
|
+
* Empty for a Collection with no `table:columns`. Read from the catalogue
|
|
309
|
+
* alone, so it lists a column no loaded record holds, which
|
|
310
|
+
* `collectFieldNames` does not.
|
|
311
|
+
*/
|
|
312
|
+
export declare function readCollectionFieldNames(collection: StacCollection): string[];
|
|
313
|
+
/** Each declared column `type`, keyed by field name. A column with no `type` is absent. */
|
|
314
|
+
export declare function readCollectionFieldTypes(collection: StacCollection): Record<string, string>;
|
|
315
|
+
/**
|
|
316
|
+
* Each column's `values` picklist, keyed by field name. A value is returned as
|
|
317
|
+
* stored, string or number. An entry with no label, or with a value of any
|
|
318
|
+
* other kind, is dropped, and a column left with no entries is absent.
|
|
319
|
+
*/
|
|
320
|
+
export declare function readCollectionFieldValues(collection: StacCollection): Record<string, TableColumnValue[]>;
|
|
321
|
+
/**
|
|
322
|
+
* Each column's `quac:value_relation`, keyed by field name — the
|
|
323
|
+
* counterpart of the write in `stacCatalogue.ts`. A column declaring none is
|
|
324
|
+
* absent from the result. An entry missing its Collection id, `key` or `value`
|
|
325
|
+
* is dropped, and an `order_by` that is not `value`, or `field` without an
|
|
326
|
+
* `order_field`, reads as ordered by key.
|
|
327
|
+
*/
|
|
328
|
+
export declare function readCollectionFieldValueRelations(collection: StacCollection): Record<string, TableColumnValueRelation>;
|
|
329
|
+
/**
|
|
330
|
+
* The units a Collection's source measures in, or null where it names none or
|
|
331
|
+
* names anything this does not read, which is read as QGIS's default of square
|
|
332
|
+
* metres and metres.
|
|
333
|
+
*/
|
|
334
|
+
export declare function readCollectionMeasurement(collection: StacCollection | null | undefined): ProjectMeasurement | null;
|
|
335
|
+
/** The image a Collection shows in place of its legend (`quac:legend_image`), or null where it names none a browser draws. */
|
|
336
|
+
export declare function readCollectionLegendImage(collection: StacCollection | null | undefined): string | null;
|
|
337
|
+
/** The icon drawn beside a Collection's name (`quac:icon`), or null where it names no `https://` address. */
|
|
338
|
+
export declare function readCollectionIcon(collection: StacCollection | null | undefined): string | null;
|
|
339
|
+
/**
|
|
340
|
+
* Reads `quac:locks` back off a Collection: the edits it locks, each `true` or
|
|
341
|
+
* `{ expression }`. A member that is neither, or an expression that is blank,
|
|
342
|
+
* is not read, so the edit stays as the rest of the Collection allows.
|
|
343
|
+
*/
|
|
344
|
+
export declare function readCollectionLocks(collection: StacCollection): LayerLocks;
|
|
345
|
+
/** A filter a Collection's source sets up: the field, and the name it is shown under, null where the source gives none. */
|
|
346
|
+
export interface CollectionFilter {
|
|
347
|
+
field: string;
|
|
348
|
+
name: string | null;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Reads `quac:filters` back off a Collection, in order. An entry with no
|
|
352
|
+
* field is not read, and a later entry on a field already read is dropped,
|
|
353
|
+
* since a layer holds one filter per field.
|
|
354
|
+
*/
|
|
355
|
+
export declare function readCollectionFilters(collection: StacCollection): CollectionFilter[];
|
|
356
|
+
/** Whether a Collection is private: its source keeps it out of the legend. */
|
|
357
|
+
export declare function readCollectionPrivate(collection: StacCollection): boolean;
|
|
358
|
+
/**
|
|
359
|
+
* The fields a Collection declares as holding a file, keyed by field name —
|
|
360
|
+
* the counterpart of the `quac:attachment` write in `stacCatalogue.ts`.
|
|
361
|
+
* A column declaring none is absent from the result.
|
|
362
|
+
*
|
|
363
|
+
* An omitted `viewer`, `filter` or `default_root` reads as null, and an
|
|
364
|
+
* omitted or unrecognised `relative_storage` as absolute.
|
|
365
|
+
*/
|
|
366
|
+
export declare function readCollectionFieldAttachments(collection: StacCollection): Record<string, FieldAttachment>;
|
|
367
|
+
/**
|
|
368
|
+
* What each column says about changing it, keyed by field name — the
|
|
369
|
+
* counterpart of the `quac:editable`, `quac:default`,
|
|
370
|
+
* `quac:constraints`, `quac:hidden`, `quac:searchable` and
|
|
371
|
+
* `quac:reuse_last_value` writes in `stacCatalogue.ts`. A column
|
|
372
|
+
* declaring none of them is absent from the result.
|
|
373
|
+
*
|
|
374
|
+
* Only `quac:editable: false` makes a field read-only, only
|
|
375
|
+
* `quac:searchable: false` keeps it out of a search, and only
|
|
376
|
+
* `quac:hidden: true`, `quac:reuse_last_value: true` and `quac:color: true`
|
|
377
|
+
* set theirs. A `quac:icon` that is not an `https://` address is left out, as
|
|
378
|
+
* is a `quac:control` other than `buttons` or `dropdown`.
|
|
379
|
+
* A default of an unrecognised `kind`, or a `fixed` one without a `value`, is
|
|
380
|
+
* left out; a `uuid` one of an omitted or unrecognised `format` reads as
|
|
381
|
+
* `with_braces`. A `not_null` or `unique` other than `enforced` or `warn` reads
|
|
382
|
+
* as none, and a `quac:duplicate_policy` other than `default` or `unset`
|
|
383
|
+
* reads as none. A constraint `expression` or a default of `kind` `expression`
|
|
384
|
+
* with no expression text is left out.
|
|
385
|
+
*/
|
|
386
|
+
export declare function readCollectionFieldEditRules(collection: StacCollection): Record<string, FieldEditRule>;
|
|
387
|
+
/** A Collection's form layout: the fields it places, in its order, and the columns it leaves out. */
|
|
388
|
+
export interface CollectionFormLayout extends LayerFormLayout {
|
|
389
|
+
/** The columns the layout does not place. The form leaves them out. */
|
|
390
|
+
unplaced: string[];
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* The form layout the source declared, counterpart of the `quac:form_order`,
|
|
394
|
+
* `quac:visible_when`, `quac:in_form` and `quac:editable_when` writes in `stacCatalogue.ts`. Null for
|
|
395
|
+
* a Collection with no `quac:form_order`, whose form places every field.
|
|
396
|
+
*
|
|
397
|
+
* A placed field's `visibleWhen` is its column's `quac:visible_when`, with a
|
|
398
|
+
* blank or non-text entry left out and each expression kept as written: whether
|
|
399
|
+
* it can be read is for the caller. A name in the order that is not text is
|
|
400
|
+
* skipped. Its `editableWhen` is its column's `quac:editable_when`, as written.
|
|
401
|
+
* A column is unplaced only when it says `quac:in_form: false` and the
|
|
402
|
+
* order does not list it.
|
|
403
|
+
*/
|
|
404
|
+
export declare function readCollectionFormLayout(collection: StacCollection): CollectionFormLayout | null;
|
|
405
|
+
/** Whether the source declares the layer editable. */
|
|
406
|
+
export declare function readCollectionEditable(collection: StacCollection): boolean | null;
|
|
407
|
+
/** Whether the source lets the layer be the active layer. */
|
|
408
|
+
export declare function readCollectionIdentifiable(collection: StacCollection): boolean | null;
|
|
409
|
+
/** Whether the source has the layer, or the group a Catalog stands for, switched on. */
|
|
410
|
+
export declare function readCollectionVisibility(collection: StacCollection | StacCatalog): boolean | null;
|
|
411
|
+
/** The layer's geometry type as QGIS names it ("Point", "Line", "Polygon", "No geometry"); null when the source gives none. */
|
|
412
|
+
export declare function readCollectionGeometryType(collection: StacCollection): string | null;
|
|
413
|
+
/** The scales the source draws the layer between; null when it sets no limit. */
|
|
414
|
+
export declare function readCollectionScaleRange(collection: StacCollection): LayerScaleRange | null;
|
|
415
|
+
/**
|
|
416
|
+
* The opacity a Collection declares for its layer, as `quac:opacity` (0 to 1).
|
|
417
|
+
*
|
|
418
|
+
* Null for a Collection that states none, which is every source with no
|
|
419
|
+
* project author behind it, and for a value that is not a number above 0: a
|
|
420
|
+
* layer declared fully transparent would open invisible with nothing saying
|
|
421
|
+
* why, so it is read as stating nothing. A caller draws a layer that states
|
|
422
|
+
* none at full opacity.
|
|
423
|
+
*/
|
|
424
|
+
export declare function readCollectionOpacity(collection: StacCollection): number | null;
|
|
425
|
+
/** A layer's opacity as `readCollectionOpacity` reads it, for a source that holds the number without a Collection. */
|
|
426
|
+
export declare function statedOpacity(value: unknown): number | null;
|
|
427
|
+
/**
|
|
428
|
+
* The relations a Collection declares — the counterpart of the
|
|
429
|
+
* `quac:related_to` write in `buildCollection` above, kept beside it so
|
|
430
|
+
* the two cannot drift.
|
|
431
|
+
*
|
|
432
|
+
* An empty result means the Collection is a map layer like any other. A relation
|
|
433
|
+
* missing its id, its parent Collection id or every field pair is dropped, since
|
|
434
|
+
* none of those describes a join a reader could follow.
|
|
435
|
+
*/
|
|
436
|
+
export declare function readCollectionRelatedTo(collection: StacCollection): CollectionRelation[];
|
|
437
|
+
/** The box covering every given box, or null when none is given. */
|
|
438
|
+
export declare function unionBboxes(boxes: Array<NormalizedBbox | null>): NormalizedBbox | null;
|
|
439
|
+
/**
|
|
440
|
+
* STAC's `extent.spatial.bbox` is an array of bboxes. We emit one, falling
|
|
441
|
+
* back to the world extent when no bbox is known.
|
|
442
|
+
*
|
|
443
|
+
* `temporal` is required on a Collection extent, so it is always emitted.
|
|
444
|
+
* A source that declares no temporal range gets the open interval
|
|
445
|
+
* `[[null, null]]` — the spec's "unbounded at both ends".
|
|
446
|
+
*/
|
|
447
|
+
export declare function buildStacExtent(bbox: NormalizedBbox | null, interval?: Array<string | null>): StacExtent;
|
|
448
|
+
/**
|
|
449
|
+
* Lower-cases, replaces non-alphanumerics with hyphens, collapses repeats.
|
|
450
|
+
* STAC ids should be URL-safe; this is a conservative slugifier.
|
|
451
|
+
*/
|
|
452
|
+
export declare function slugify(input: string): string;
|