@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,37 @@
|
|
|
1
|
+
import type { StacAsset, StacCatalog } from '../model/Stac.ts';
|
|
2
|
+
import type { WfsCapabilities } from '../model/wfs.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Generates a STAC Catalog tree from a WFS GetCapabilities response:
|
|
5
|
+
* the service → top-level Catalog
|
|
6
|
+
* each <FeatureType> → Collection with `quac:wfs_*` fields and a GetFeature asset
|
|
7
|
+
*
|
|
8
|
+
* A WFS service publishes a flat list of feature types, so the catalogue has
|
|
9
|
+
* no nested Catalogs. It also declares no author intent — no default
|
|
10
|
+
* visibility or display field — so those shared fields are left off the
|
|
11
|
+
* Collections rather than invented.
|
|
12
|
+
*
|
|
13
|
+
* Field schemas are not part of the output: they come from
|
|
14
|
+
* DescribeFeatureType, which is a per-layer fetch at load time rather than
|
|
15
|
+
* something GetCapabilities provides.
|
|
16
|
+
*
|
|
17
|
+
* Pure function — no side effects, no I/O. The caller fetches and parses the
|
|
18
|
+
* capabilities document (`fetchWfsCapabilities`) and passes the result in.
|
|
19
|
+
* `WfsCapabilities` is a type-only import, so this keeps the package free of
|
|
20
|
+
* runtime app dependencies.
|
|
21
|
+
*/
|
|
22
|
+
export interface WfsStacCatalogueOptions {
|
|
23
|
+
/**
|
|
24
|
+
* Feature type names to emit, in the order given. A name the service does
|
|
25
|
+
* not publish is skipped. Omit to emit every advertised feature type.
|
|
26
|
+
*/
|
|
27
|
+
typeNames?: string[];
|
|
28
|
+
/** Service title override, used when the capabilities document declares none. */
|
|
29
|
+
title?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function generateStacCatalogueFromWfsCapabilities(endpoint: string, capabilities: WfsCapabilities, options?: WfsStacCatalogueOptions): StacCatalog;
|
|
32
|
+
/**
|
|
33
|
+
* A WFS layer's data asset: a GetFeature request for one feature type as
|
|
34
|
+
* GeoJSON, which an HTTP GET answers in full and `parseWfsGetFeatureUrl` reads
|
|
35
|
+
* back. Every producer that publishes a WFS source writes it here.
|
|
36
|
+
*/
|
|
37
|
+
export declare function wfsGetFeatureAsset(endpoint: string, typeName: string, title: string): StacAsset;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { generateStacFromNormalized, slugify } from "./normalizedProject.js";
|
|
2
|
+
import { GEOJSON_MEDIA_TYPE } from "../util/catalogueFileFormats.js";
|
|
3
|
+
import { WFS_CAPABILITIES_VERSION } from "../util/wfsVersions.js";
|
|
4
|
+
export function generateStacCatalogueFromWfsCapabilities(endpoint, capabilities, options = {}) {
|
|
5
|
+
return generateStacFromNormalized(wfsCapabilitiesToNormalized(endpoint, capabilities, options));
|
|
6
|
+
}
|
|
7
|
+
/** Projects a parsed WFS capabilities document into the source-agnostic normalized model. */
|
|
8
|
+
function wfsCapabilitiesToNormalized(endpoint, capabilities, options) {
|
|
9
|
+
const featureTypes = selectFeatureTypes(capabilities, options.typeNames);
|
|
10
|
+
const title = capabilities.serviceTitle?.trim() || options.title?.trim() || '';
|
|
11
|
+
const vendorFields = {
|
|
12
|
+
'quac:wfs_endpoint': endpoint,
|
|
13
|
+
'quac:wfs_version': capabilities.version
|
|
14
|
+
};
|
|
15
|
+
if (capabilities.getFeatureOutputFormats.length > 0) {
|
|
16
|
+
vendorFields['quac:wfs_output_formats'] = capabilities.getFeatureOutputFormats;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
id: slugify(title || 'wfs-service') || 'wfs-service',
|
|
20
|
+
title,
|
|
21
|
+
description: title
|
|
22
|
+
? `STAC catalogue generated from the WFS GetCapabilities response for "${title}".`
|
|
23
|
+
: 'STAC catalogue generated from a WFS GetCapabilities response.',
|
|
24
|
+
bbox: unionBbox(featureTypes),
|
|
25
|
+
vendorFields,
|
|
26
|
+
nodes: featureTypes.map((featureType) => wfsFeatureTypeToNormalized(endpoint, featureType))
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Resolves the requested type names against the published list, preserving the
|
|
31
|
+
* caller's order. With no names given, every published feature type is emitted
|
|
32
|
+
* in the order the service listed them.
|
|
33
|
+
*/
|
|
34
|
+
function selectFeatureTypes(capabilities, typeNames) {
|
|
35
|
+
if (!typeNames)
|
|
36
|
+
return capabilities.featureTypes;
|
|
37
|
+
const byName = new Map(capabilities.featureTypes.map((featureType) => [featureType.name, featureType]));
|
|
38
|
+
return typeNames
|
|
39
|
+
.map((name) => byName.get(name))
|
|
40
|
+
.filter((featureType) => Boolean(featureType));
|
|
41
|
+
}
|
|
42
|
+
function wfsFeatureTypeToNormalized(endpoint, featureType) {
|
|
43
|
+
const title = featureType.title || featureType.name;
|
|
44
|
+
return {
|
|
45
|
+
kind: 'layer',
|
|
46
|
+
// The feature type name is the service's own handle for the layer and the
|
|
47
|
+
// half of the layer's identity that the connection's endpoint completes.
|
|
48
|
+
id: featureType.name,
|
|
49
|
+
title,
|
|
50
|
+
description: featureType.abstract?.trim()
|
|
51
|
+
|| `Layer "${title}" from a map server.`,
|
|
52
|
+
bbox: wgs84BoxToNormalized(featureType.wgs84BoundingBox),
|
|
53
|
+
// GetCapabilities does not declare geometry types; the geometry column and
|
|
54
|
+
// its type come from DescribeFeatureType at load time.
|
|
55
|
+
geometryType: null,
|
|
56
|
+
tableColumns: [],
|
|
57
|
+
assets: { data: wfsGetFeatureAsset(endpoint, featureType.name, featureType.name) },
|
|
58
|
+
keywords: featureType.keywords,
|
|
59
|
+
links: featureType.metadataUrls.map((href) => ({ rel: 'describedby', href })),
|
|
60
|
+
displayField: null,
|
|
61
|
+
visibilityChecked: null,
|
|
62
|
+
editable: null,
|
|
63
|
+
vendorFields: buildVendorFields(endpoint, featureType)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A WFS layer's data asset: a GetFeature request for one feature type as
|
|
68
|
+
* GeoJSON, which an HTTP GET answers in full and `parseWfsGetFeatureUrl` reads
|
|
69
|
+
* back. Every producer that publishes a WFS source writes it here.
|
|
70
|
+
*/
|
|
71
|
+
export function wfsGetFeatureAsset(endpoint, typeName, title) {
|
|
72
|
+
const params = new URLSearchParams({
|
|
73
|
+
SERVICE: 'WFS',
|
|
74
|
+
VERSION: WFS_CAPABILITIES_VERSION,
|
|
75
|
+
REQUEST: 'GetFeature',
|
|
76
|
+
TYPENAMES: typeName,
|
|
77
|
+
OUTPUTFORMAT: 'application/json'
|
|
78
|
+
});
|
|
79
|
+
const separator = endpoint.includes('?') ? '&' : '?';
|
|
80
|
+
return {
|
|
81
|
+
href: `${endpoint}${separator}${params.toString()}`,
|
|
82
|
+
type: GEOJSON_MEDIA_TYPE,
|
|
83
|
+
title: `WFS GetFeature: ${title}`,
|
|
84
|
+
roles: ['data']
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function buildVendorFields(endpoint, featureType) {
|
|
88
|
+
const fields = {
|
|
89
|
+
'quac:wfs_endpoint': endpoint,
|
|
90
|
+
'quac:wfs_type_name': featureType.name
|
|
91
|
+
};
|
|
92
|
+
if (featureType.defaultSrs)
|
|
93
|
+
fields['quac:wfs_default_srs'] = featureType.defaultSrs;
|
|
94
|
+
if (featureType.supportedSrs.length > 0)
|
|
95
|
+
fields['quac:wfs_supported_srs'] = featureType.supportedSrs;
|
|
96
|
+
// Advertised per-type operations say what the service will accept, which is
|
|
97
|
+
// what decides whether the layer can be edited. Many servers omit the
|
|
98
|
+
// element; the field is then absent rather than guessed.
|
|
99
|
+
if (featureType.operations)
|
|
100
|
+
fields['quac:wfs_operations'] = featureType.operations;
|
|
101
|
+
return fields;
|
|
102
|
+
}
|
|
103
|
+
function wgs84BoxToNormalized(box) {
|
|
104
|
+
if (!box)
|
|
105
|
+
return null;
|
|
106
|
+
return { xmin: box.minX, ymin: box.minY, xmax: box.maxX, ymax: box.maxY };
|
|
107
|
+
}
|
|
108
|
+
/** Union of every emitted feature type's WGS84 box, or null when none declares one. */
|
|
109
|
+
function unionBbox(featureTypes) {
|
|
110
|
+
let union = null;
|
|
111
|
+
for (const featureType of featureTypes) {
|
|
112
|
+
const box = wgs84BoxToNormalized(featureType.wgs84BoundingBox);
|
|
113
|
+
if (!box)
|
|
114
|
+
continue;
|
|
115
|
+
if (!union) {
|
|
116
|
+
union = box;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
union = {
|
|
120
|
+
xmin: Math.min(union.xmin, box.xmin),
|
|
121
|
+
ymin: Math.min(union.ymin, box.ymin),
|
|
122
|
+
xmax: Math.max(union.xmax, box.xmax),
|
|
123
|
+
ymax: Math.max(union.ymax, box.ymax)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return union;
|
|
127
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { StacCatalog } from '../model/Stac.ts';
|
|
2
|
+
import type { WfsCapabilities } from '../model/wfs.ts';
|
|
3
|
+
import type { WmsProject } from '../model/WmsProject.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Generates a STAC Catalog tree from a parsed WmsProject (from QGIS Server
|
|
6
|
+
* GetProjectSettings). Shares the generator core with the static-QGS path:
|
|
7
|
+
* WmsProject → top-level Catalog
|
|
8
|
+
* layer-tree groups → nested Catalogs
|
|
9
|
+
* leaf data layers → Collections
|
|
10
|
+
* <Attribute>s → table:columns (with proper type info — richer
|
|
11
|
+
* than the .qgs path because GetProjectSettings
|
|
12
|
+
* exposes typeName for every field)
|
|
13
|
+
*
|
|
14
|
+
* This is a thin wrapper: `wmsProjectToNormalized` resolves the WMS-specific
|
|
15
|
+
* wording, assets and columns into the shared `NormalizedProject`, and
|
|
16
|
+
* `generateStacFromNormalized` (see normalizedProject.ts) builds the catalogue.
|
|
17
|
+
*/
|
|
18
|
+
export interface WmsStacCatalogueOptions {
|
|
19
|
+
/**
|
|
20
|
+
* The WFS endpoint serving this project's published feature types — the
|
|
21
|
+
* same base URL with every query parameter but `MAP` stripped. When given,
|
|
22
|
+
* each WFS-published layer's Collection has `quac:wfs_endpoint`, and
|
|
23
|
+
* `quac:wfs_type_name` when `wfsCapabilities` resolves it.
|
|
24
|
+
*/
|
|
25
|
+
wfsEndpoint?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The parsed WFS GetCapabilities response for `wfsEndpoint`. QGIS Server
|
|
28
|
+
* sanitises WFS type names ("Graffiti Reports" → "Graffiti_Reports"), so a
|
|
29
|
+
* WMS layer's feature type is resolved by matching: the feature type whose
|
|
30
|
+
* title equals the WMS layer's title, then the one whose title equals the
|
|
31
|
+
* WMS name, then the one whose name equals the WMS name. An unmatched
|
|
32
|
+
* published layer still has `quac:wfs_endpoint` but gets no `quac:wfs_type_name`.
|
|
33
|
+
*
|
|
34
|
+
* Type-only import — the caller fetches the capabilities, so this package
|
|
35
|
+
* has no runtime app dependencies.
|
|
36
|
+
*/
|
|
37
|
+
wfsCapabilities?: WfsCapabilities;
|
|
38
|
+
/**
|
|
39
|
+
* The project address the WMS GetProjectSettings was read from. When given,
|
|
40
|
+
* each layer not published for WFS has a `rel: "wms"` link requesting it
|
|
41
|
+
* from the same address, so it is drawn as a WMS image.
|
|
42
|
+
*/
|
|
43
|
+
wmsEndpoint?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare function generateStacCatalogueFromWms(project: WmsProject, options?: WmsStacCatalogueOptions): StacCatalog;
|
|
46
|
+
export declare function mapQtTypeToStacTableType(qtType: string, typeName: string): string | undefined;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { slugify, generateStacFromNormalized } from "./normalizedProject.js";
|
|
2
|
+
import { wfsGetFeatureAsset } from "./wfsStacCatalogue.js";
|
|
3
|
+
import { chooseWmsCrs, WEB_MAP_LINKS_EXTENSION, wmsEndpoint } from "../model/stacWms.js";
|
|
4
|
+
import { GEOJSON_MEDIA_TYPE } from "../util/catalogueFileFormats.js";
|
|
5
|
+
export function generateStacCatalogueFromWms(project, options = {}) {
|
|
6
|
+
return generateStacFromNormalized(wmsProjectToNormalized(project, options));
|
|
7
|
+
}
|
|
8
|
+
function buildWfsSourceResolver(project, options) {
|
|
9
|
+
const endpoint = options.wfsEndpoint;
|
|
10
|
+
if (!endpoint)
|
|
11
|
+
return () => null;
|
|
12
|
+
const wfsPublished = new Set(project.wfsLayerNames);
|
|
13
|
+
const featureTypes = options.wfsCapabilities?.featureTypes ?? [];
|
|
14
|
+
const featureTypeByTitle = new Map(featureTypes.map((ft) => [ft.title, ft]));
|
|
15
|
+
const featureTypeByName = new Map(featureTypes.map((ft) => [ft.name, ft]));
|
|
16
|
+
return (layer) => {
|
|
17
|
+
if (!wfsPublished.has(layer.name))
|
|
18
|
+
return null;
|
|
19
|
+
const featureType = featureTypeByTitle.get(layer.title)
|
|
20
|
+
?? featureTypeByTitle.get(layer.name)
|
|
21
|
+
?? featureTypeByName.get(layer.name);
|
|
22
|
+
return { endpoint, typeName: featureType?.name ?? null };
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Projects a parsed WmsProject into the source-agnostic normalized model. */
|
|
26
|
+
function wmsProjectToNormalized(project, options) {
|
|
27
|
+
return {
|
|
28
|
+
id: slugify(project.title || 'qgis-server-project') || 'qgis-server-project',
|
|
29
|
+
title: project.title,
|
|
30
|
+
description: project.title
|
|
31
|
+
? `STAC catalogue generated from QGIS Server WMS GetProjectSettings for "${project.title}".`
|
|
32
|
+
: 'STAC catalogue generated from a QGIS Server WMS GetProjectSettings response.',
|
|
33
|
+
bbox: project.bbox ? wmsBboxToNormalized(project.bbox) : null,
|
|
34
|
+
nodes: walkWmsNodes(project.layerTree, {
|
|
35
|
+
resolveWfsSource: buildWfsSourceResolver(project, options),
|
|
36
|
+
wfsPublished: new Set(project.wfsLayerNames),
|
|
37
|
+
wmsEndpoint: options.wmsEndpoint ? wmsEndpoint(options.wmsEndpoint) : null
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function walkWmsNodes(nodes, context) {
|
|
42
|
+
const out = [];
|
|
43
|
+
for (const node of nodes) {
|
|
44
|
+
if (node.kind === 'layer') {
|
|
45
|
+
const wmsLink = context.wmsEndpoint && !context.wfsPublished.has(node.name)
|
|
46
|
+
? buildQgisServerWmsLink(context.wmsEndpoint, node)
|
|
47
|
+
: null;
|
|
48
|
+
out.push(wmsLink ? wmsOnlyLayerToNormalized(node, wmsLink) : wmsLayerToNormalized(node, context.resolveWfsSource(node)));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const subId = slugify(node.title || node.name || 'group') || 'group';
|
|
52
|
+
out.push({
|
|
53
|
+
kind: 'group',
|
|
54
|
+
id: subId,
|
|
55
|
+
title: node.title || node.name,
|
|
56
|
+
description: `Layer group "${node.title || node.name || subId}" from the QGIS Server project.`,
|
|
57
|
+
...(node.mutuallyExclusive ? { mutuallyExclusive: true } : {}),
|
|
58
|
+
children: walkWmsNodes(node.children, context)
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
function wmsLayerToNormalized(layer, wfsSource) {
|
|
65
|
+
return {
|
|
66
|
+
kind: 'layer',
|
|
67
|
+
id: layer.name,
|
|
68
|
+
title: layer.title || layer.name,
|
|
69
|
+
description: `Layer "${layer.title || layer.name}" from the QGIS Server project.`,
|
|
70
|
+
bbox: layer.bbox ? wmsBboxToNormalized(layer.bbox) : null,
|
|
71
|
+
geometryType: mapWkbGeometryType(layer.geometryType),
|
|
72
|
+
wkbTypes: layer.geometryType ? [layer.geometryType] : [],
|
|
73
|
+
qgisServerNames: { wmsName: layer.name, wfsTypeName: wfsSource?.typeName ?? null },
|
|
74
|
+
tableColumns: layer.attributes.length > 0 ? deriveTableColumnsFromAttributes(layer.attributes) : [],
|
|
75
|
+
assets: buildAssets(layer, wfsSource),
|
|
76
|
+
displayField: layer.displayField,
|
|
77
|
+
visibilityChecked: layer.visibilityChecked,
|
|
78
|
+
// GetProjectSettings does not expose readOnly, so we don't emit
|
|
79
|
+
// `quac:editable` from this path.
|
|
80
|
+
editable: null,
|
|
81
|
+
identifiable: layer.queryable,
|
|
82
|
+
scaleRange: layer.scaleRange,
|
|
83
|
+
opacity: layer.opacity,
|
|
84
|
+
vendorFields: buildVendorFields(wfsSource)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A GetMap link for a layer QGIS Server publishes only over WMS. The style is
|
|
89
|
+
* left empty, which asks the server for the layer's default style. No version
|
|
90
|
+
* is stated, so the app asks the server for it when the layer is first shown.
|
|
91
|
+
*/
|
|
92
|
+
function buildQgisServerWmsLink(endpoint, layer) {
|
|
93
|
+
return {
|
|
94
|
+
rel: 'wms',
|
|
95
|
+
href: endpoint,
|
|
96
|
+
type: 'image/png',
|
|
97
|
+
'wms:layers': [layer.name],
|
|
98
|
+
'wms:styles': [''],
|
|
99
|
+
'wms:transparent': true,
|
|
100
|
+
'quac:wms_crs': chooseWmsCrs(layer.crsList)
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A layer QGIS Server publishes only over WMS: an image layer, so it has no data
|
|
105
|
+
* asset, fields or editing, as a QGIS project's WMS layer has none.
|
|
106
|
+
*/
|
|
107
|
+
function wmsOnlyLayerToNormalized(layer, wmsLink) {
|
|
108
|
+
return {
|
|
109
|
+
kind: 'layer',
|
|
110
|
+
id: layer.name,
|
|
111
|
+
title: layer.title || layer.name,
|
|
112
|
+
description: `Layer "${layer.title || layer.name}" from the QGIS Server project.`,
|
|
113
|
+
bbox: layer.bbox ? wmsBboxToNormalized(layer.bbox) : null,
|
|
114
|
+
geometryType: mapWkbGeometryType(layer.geometryType),
|
|
115
|
+
wkbTypes: layer.geometryType ? [layer.geometryType] : [],
|
|
116
|
+
qgisServerNames: { wmsName: layer.name, wfsTypeName: null },
|
|
117
|
+
tableColumns: [],
|
|
118
|
+
assets: {},
|
|
119
|
+
displayField: null,
|
|
120
|
+
visibilityChecked: layer.visibilityChecked,
|
|
121
|
+
editable: false,
|
|
122
|
+
identifiable: layer.queryable,
|
|
123
|
+
scaleRange: layer.scaleRange,
|
|
124
|
+
opacity: layer.opacity,
|
|
125
|
+
vendorFields: {},
|
|
126
|
+
links: [wmsLink],
|
|
127
|
+
extensions: [WEB_MAP_LINKS_EXTENSION]
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function buildVendorFields(wfsSource) {
|
|
131
|
+
if (!wfsSource)
|
|
132
|
+
return {};
|
|
133
|
+
const fields = { 'quac:wfs_endpoint': wfsSource.endpoint };
|
|
134
|
+
if (wfsSource.typeName)
|
|
135
|
+
fields['quac:wfs_type_name'] = wfsSource.typeName;
|
|
136
|
+
return fields;
|
|
137
|
+
}
|
|
138
|
+
function wmsBboxToNormalized(bbox) {
|
|
139
|
+
return {
|
|
140
|
+
xmin: bbox.westBoundLongitude,
|
|
141
|
+
ymin: bbox.southBoundLatitude,
|
|
142
|
+
xmax: bbox.eastBoundLongitude,
|
|
143
|
+
ymax: bbox.northBoundLatitude
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function buildAssets(layer, wfsSource) {
|
|
147
|
+
if (wfsSource?.typeName)
|
|
148
|
+
return { data: wfsGetFeatureAsset(wfsSource.endpoint, wfsSource.typeName, layer.name) };
|
|
149
|
+
// Without a resolved type the href is left empty: the live URL is
|
|
150
|
+
// server-specific and is constructed by the QgisServerAdapter at fetch
|
|
151
|
+
// time, so the asset entry only documents that the data is available.
|
|
152
|
+
return {
|
|
153
|
+
data: {
|
|
154
|
+
href: '',
|
|
155
|
+
type: GEOJSON_MEDIA_TYPE,
|
|
156
|
+
// Text written into the catalogue document, which carries the project's own name.
|
|
157
|
+
title: `WFS GetFeature: ${layer.name}`,
|
|
158
|
+
roles: ['data']
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Maps QGIS Qt types from GetProjectSettings into STAC Table extension
|
|
164
|
+
* type strings. The table extension uses byte/short/int/long/float/double/
|
|
165
|
+
* boolean/string/timestamp/date/time.
|
|
166
|
+
*/
|
|
167
|
+
function deriveTableColumnsFromAttributes(attributes) {
|
|
168
|
+
return attributes.map((attr) => {
|
|
169
|
+
const column = { name: attr.name };
|
|
170
|
+
if (attr.alias)
|
|
171
|
+
column.title = attr.alias;
|
|
172
|
+
const stacType = mapQtTypeToStacTableType(attr.type, attr.typeName);
|
|
173
|
+
if (stacType)
|
|
174
|
+
column.type = stacType;
|
|
175
|
+
return column;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* QGIS's geometry kind for each WKB type name QGIS Server writes, less any Z,
|
|
180
|
+
* M, ZM or 25D suffix (`qgswkbtypes.cpp`, `qgis/QGIS@master`, read
|
|
181
|
+
* 2026-10-17), named as a QGIS project file names it. A name absent here, such
|
|
182
|
+
* as `GeometryCollection`, has no geometry type.
|
|
183
|
+
*/
|
|
184
|
+
const GEOMETRY_TYPE_BY_WKB_NAME = {
|
|
185
|
+
Point: 'Point',
|
|
186
|
+
MultiPoint: 'Point',
|
|
187
|
+
LineString: 'Line',
|
|
188
|
+
MultiLineString: 'Line',
|
|
189
|
+
CircularString: 'Line',
|
|
190
|
+
CompoundCurve: 'Line',
|
|
191
|
+
NurbsCurve: 'Line',
|
|
192
|
+
MultiCurve: 'Line',
|
|
193
|
+
Polygon: 'Polygon',
|
|
194
|
+
MultiPolygon: 'Polygon',
|
|
195
|
+
Triangle: 'Polygon',
|
|
196
|
+
CurvePolygon: 'Polygon',
|
|
197
|
+
MultiSurface: 'Polygon',
|
|
198
|
+
PolyhedralSurface: 'Polygon',
|
|
199
|
+
TIN: 'Polygon',
|
|
200
|
+
NoGeometry: 'No geometry'
|
|
201
|
+
};
|
|
202
|
+
function mapWkbGeometryType(wkbName) {
|
|
203
|
+
const base = wkbName?.replace(/(ZM|Z|M|25D)$/, '');
|
|
204
|
+
return base && Object.hasOwn(GEOMETRY_TYPE_BY_WKB_NAME, base) ? GEOMETRY_TYPE_BY_WKB_NAME[base] : null;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Qt type names, as QGIS Server writes them, mapped to column types. They're
|
|
208
|
+
* more deterministic than the human typeName, which can vary by locale.
|
|
209
|
+
*/
|
|
210
|
+
const QT_COLUMN_TYPES = {
|
|
211
|
+
int: 'int',
|
|
212
|
+
qlonglong: 'long',
|
|
213
|
+
double: 'double',
|
|
214
|
+
float: 'double',
|
|
215
|
+
bool: 'boolean',
|
|
216
|
+
QDateTime: 'timestamp',
|
|
217
|
+
QDate: 'date',
|
|
218
|
+
QTime: 'time',
|
|
219
|
+
QString: 'string'
|
|
220
|
+
};
|
|
221
|
+
export function mapQtTypeToStacTableType(qtType, typeName) {
|
|
222
|
+
if (Object.hasOwn(QT_COLUMN_TYPES, qtType))
|
|
223
|
+
return QT_COLUMN_TYPES[qtType];
|
|
224
|
+
// Fall back to the human name for unfamiliar types.
|
|
225
|
+
if (typeName)
|
|
226
|
+
return typeName.toLowerCase();
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package's public API: everything an application imports from
|
|
3
|
+
* `@vectoriahq/quac`.
|
|
4
|
+
*/
|
|
5
|
+
export type { QgsProject, ProjectMetadata, MapExtent, BoundingBox, LayerEntry, EditLock, LayerLocks, LockedEdit, ProjectMeasurement, LayerStyle, LayerResourceMetadata, LayerScaleRange, LayerContact, LayerAttribution, FieldAttachment, FieldCheckbox, FieldConstraintExpression, FieldDefaultExpression, FieldDefaultValue, FieldEditRule, FormLayoutField, LayerFormLayout, FieldFixedValue, FieldRange, FieldUuidFormat, FieldValueMapEntry, DataSource, FileDataSource, WfsDataSource, WmsDataSource, UnsupportedDataSource, LayerTreeNode, LayerGroup, LayerTreeLeaf, QgsRelation, QgsRelationFieldPair } from './model/QgsProject.ts';
|
|
6
|
+
export type { StacCatalog, StacCollection, StacItem, StacAsset, StacExtent, StacLink, StacObject, StacProvider, TableColumn, TableColumnType, TableColumnValue, TableColumnValueRelation, TableColumnAttachment, TableColumnCheckbox, TableColumnRange } from './model/Stac.ts';
|
|
7
|
+
export { STAC_VERSION } from './model/Stac.ts';
|
|
8
|
+
export { isIconLibraryAddress, resolveFieldIconAddress } from './model/fieldIconAddress.ts';
|
|
9
|
+
export { collectCollectionStyles, getDefaultStyle, styleAssetKey, GL_STYLE_MEDIA_TYPE } from './model/stacStyles.ts';
|
|
10
|
+
export type { StacStyle, StyleOverrideReference } from './model/stacStyles.ts';
|
|
11
|
+
export { parseQgsXml } from './parse/parseQgsXml.ts';
|
|
12
|
+
export { measureFactorsOf } from './parse/parseMeasurement.ts';
|
|
13
|
+
export type { MeasureFactors } from './parse/parseMeasurement.ts';
|
|
14
|
+
export { readProjectXml } from './parse/readProjectFile.ts';
|
|
15
|
+
export { collectLayerVisibility } from './parse/collectLayerVisibility.ts';
|
|
16
|
+
export { parseDataSource } from './parse/parseDataSource.ts';
|
|
17
|
+
export { findGeometrySiblings, readGeometrySiblingShapes, readSiblingShapes, siblingCollectionId } from './parse/geometrySiblings.ts';
|
|
18
|
+
export { qmlForLayer } from './generate/qmlForLayer.ts';
|
|
19
|
+
export { generateStacCatalogue, parseQgisStyleAssetHref, isQgisPlaceholderDescription, QUAC_GEOMETRY_FILTER, QUAC_LAYER_NAME, readCollectionGeometryFilter, readCollectionLayerName } from './generate/stacCatalogue.ts';
|
|
20
|
+
export { DEFAULT_DELIMITED_TEXT_OPTIONS, QUAC_DELIMITED_TEXT, readCollectionDelimitedText } from './model/delimitedText.ts';
|
|
21
|
+
export { QUAC_FEATURE_FILTER, readCollectionFeatureFilter } from './model/featureFilter.ts';
|
|
22
|
+
export type { FeatureFilter, FeatureFilterDialect } from './model/featureFilter.ts';
|
|
23
|
+
export type { DelimitedTextOptions } from './model/delimitedText.ts';
|
|
24
|
+
export { decodeAssetPath, encodeAssetPath, isRelativeHref, readCollectionDataPath, readCollectionOnlineFile } from './model/stacHref.ts';
|
|
25
|
+
export { DATA_ROLE, findAssetByRole, readDataAsset } from './model/stacAssetRoles.ts';
|
|
26
|
+
export { THUMBNAIL_ROLE, readCollectionAttribution, readCollectionDeprecation, readCollectionSelfHref, readCollectionThumbnail } from './model/stacCollectionNotes.ts';
|
|
27
|
+
export { FILE_EXTENSION, FILE_SIZE_FIELD, TABLE_ROW_COUNT_FIELD, readCollectionRowCount, readDataAssetFileSize } from './model/stacSizeAndCount.ts';
|
|
28
|
+
export { PMTILES_MEDIA_TYPE, VISUAL_ROLE, readCollectionPmtiles } from './model/stacPmtiles.ts';
|
|
29
|
+
export type { StacPmtilesSource } from './model/stacPmtiles.ts';
|
|
30
|
+
export type { StacCompanionData } from './generate/stacCatalogue.ts';
|
|
31
|
+
export { QUAC_ACTIVE_COLLECTION_FIELD, QUAC_FILTERS_FIELD, QUAC_FORM_ORDER_FIELD, QUAC_LOCKS_FIELD, QUAC_MUTUALLY_EXCLUSIVE_FIELD, QUAC_PRIVATE_FIELD, readCatalogueActiveCollection, readCatalogueInitialView, readCollectionDisplayField, readCollectionEditable, readCollectionFieldAliases, readCollectionFieldAttachments, readCollectionFieldEditRules, readCollectionFieldNames, readCollectionFieldTypes, readCollectionFieldValueRelations, readCollectionFieldValues, readCollectionFormLayout, readCollectionGeometryType, readCollectionIdentifiable, readCollectionMeasurement, readCollectionOpacity, readCollectionIcon, readCollectionLegendImage, readCollectionFilters, readCollectionLocks, readCollectionPrivate, readCollectionRelatedTo, readCollectionScaleRange, readCollectionVisibility, statedOpacity } from './generate/normalizedProject.ts';
|
|
32
|
+
export type { CollectionFilter, CollectionFormLayout, CollectionRelation, CollectionRelationField } from './generate/normalizedProject.ts';
|
|
33
|
+
export { generateStacCatalogueFromWfsCapabilities } from './generate/wfsStacCatalogue.ts';
|
|
34
|
+
export type { WfsStacCatalogueOptions } from './generate/wfsStacCatalogue.ts';
|
|
35
|
+
export { generateStacCatalogueFromFolder } from './generate/folderStacCatalogue.ts';
|
|
36
|
+
export type { FolderCatalogueFile, FolderStacCatalogueOptions } from './generate/folderStacCatalogue.ts';
|
|
37
|
+
export { generateCollectionForDroppedFile, generateCollectionForLinkedFile } from './generate/fileLayerCollection.ts';
|
|
38
|
+
export type { DroppedFileCollectionOptions, LinkedFileCollectionOptions } from './generate/fileLayerCollection.ts';
|
|
39
|
+
export { generateStacCatalogueFromOgcCollections, resolveOgcCollectionSource } from './generate/ogcFeaturesStacCatalogue.ts';
|
|
40
|
+
export type { OgcCollectionSource, OgcFeaturesCollectionSource, OgcFeaturesStacCatalogueOptions, OgcTilesCollectionSource } from './generate/ogcFeaturesStacCatalogue.ts';
|
|
41
|
+
export { generateStacCatalogueFromArcgisLayers, readArcgisCatalogueItemId, readArcgisNotShownReason, resolveArcgisCollectionSource } from './generate/arcgisStacCatalogue.ts';
|
|
42
|
+
export type { ArcgisStacCatalogueOptions } from './generate/arcgisStacCatalogue.ts';
|
|
43
|
+
export { normalizeExternalStacCatalogue, parseWfsGetFeatureUrl, resolveWfsCollectionSource } from './generate/externalStacCatalogue.ts';
|
|
44
|
+
export { decodeItemRowId, describeItem, encodeItemRowId, itemAsCollection, ITEMS_PAGE_SIZE, readItemsHref, readItemTimestamp, sortItemsNewestFirst } from './sources/stacItems.ts';
|
|
45
|
+
export { stripQgisServerQuery } from './sources/qgisServerUrl.ts';
|
|
46
|
+
export type { WmsProject, WmsLayerTreeNode, WmsLayer, WmsLayerGroup, WmsBoundingBox, WmsStyle, WmsAttribute } from './model/WmsProject.ts';
|
|
47
|
+
export { parseGetProjectSettings } from './parse/parseGetProjectSettings.ts';
|
|
48
|
+
export { generateStacCatalogueFromWms } from './generate/wmsStacCatalogue.ts';
|
|
49
|
+
export type { WmsStacCatalogueOptions } from './generate/wmsStacCatalogue.ts';
|
|
50
|
+
export { collectCatalogueCollections, listCatalogueChildren } from './model/stacTreeWalk.ts';
|
|
51
|
+
export type { CatalogueChild } from './model/stacTreeWalk.ts';
|
|
52
|
+
export { setDevLogging } from './util/devLog.ts';
|
|
53
|
+
export type { ArcgisCodedValue, ArcgisExtent, ArcgisField, ArcgisFieldMetadata, ArcgisLayerSet, ArcgisLayerSource, ArcgisNotShownReason, ArcgisPassthrough, ArcgisRange, ArcgisResolution, ArcgisResolvedLayer } from './model/arcgis.ts';
|
|
54
|
+
export type { OgcCollection, OgcCollectionsDocument, OgcItemType, OgcLink } from './model/ogcFeatures.ts';
|
|
55
|
+
export { WEB_MAP_LINKS_EXTENSION, buildWmsLink, readCollectionWms, wmsEndpoint } from './model/stacWms.ts';
|
|
56
|
+
export type { StacWmsSource } from './model/stacWms.ts';
|
|
57
|
+
export { readCollectionWmts, wmtsCapabilitiesUrl } from './model/stacWmts.ts';
|
|
58
|
+
export type { StacWmtsSource } from './model/stacWmts.ts';
|
|
59
|
+
export { VECTOR_TILE_MEDIA_TYPE, buildXyzLink, readCollectionXyzLink, readCollectionXyzTemplate } from './model/stacXyz.ts';
|
|
60
|
+
export type { ActiveWfsLayer, WfsCapabilities, WfsDescribeFeatureTypeSchema, WfsFeatureTypeOperationsSupport, WfsFeatureTypeSummary, WfsFieldKind, WfsFieldSchema, WfsOperationName, WfsTransactionOperation, WfsTransactionResult, WfsValidationError, WfsWgs84BoundingBox } from './model/wfs.ts';
|
|
61
|
+
export { parseProjectMeasurement } from './parse/parseMeasurement.ts';
|
|
62
|
+
export { GEOMETRY_VALUES, LAYER_LOOKUP, QGIS_CONDITION, expressionToGeoStylerFunction, expressionToTemplate, isQgisConditionFilter, qgisConditionToFilter, readCurrentValueFields, readLayerLookups, readQgisExpression } from './parse/qgisExpression.ts';
|
|
63
|
+
export type { ExpressionNode, LayerLookup } from './parse/qgisExpression.ts';
|
|
64
|
+
export { formatQtDateTime, qtDatePart, readQtDateTime, splitQtDatePattern } from './parse/qtDateFormat.ts';
|
|
65
|
+
export { compileQtRegex, replaceQtRegex } from './parse/qtRegex.ts';
|
|
66
|
+
export { cloneCatalogShallow, collectAllCollections, resolveDocumentHrefs, withSelfLink } from './sources/stacDocuments.ts';
|
|
67
|
+
export { buildItemUrl, buildItemsPageUrl, readItem, readItemsPage } from './sources/stacItems.ts';
|
|
68
|
+
export type { StacItemsPage } from './sources/stacItems.ts';
|
|
69
|
+
export { CATALOGUE_FILE_FORMATS, COG_MEDIA_TYPE, CSV_MEDIA_TYPE, declaredMediaTypeForFile, FLATGEOBUF_MEDIA_TYPE, GEOJSON_MEDIA_TYPE, GEOPACKAGE_MEDIA_TYPE, hasRole, isLayerFileOfFormat, PARQUET_MEDIA_TYPE, PROJECT_DATA_ROLES, QML_STYLE_MEDIA_TYPE } from './util/catalogueFileFormats.ts';
|
|
70
|
+
export type { CatalogueFileFormat, LayerFileFormatId, LayerFileRole, RoleFilter } from './util/catalogueFileFormats.ts';
|
|
71
|
+
export { devLog } from './util/devLog.ts';
|
|
72
|
+
export { getFileNameFromPath, getLowerCaseExtension, getNormalisedFileBasename, getParentFolderPath } from './util/fileName.ts';
|
|
73
|
+
export { DEFAULT_WFS_VERSION, SPOKEN_WFS_VERSIONS, WFS_CAPABILITIES_VERSION, WFS_FALLBACK_VERSION } from './util/wfsVersions.ts';
|
|
74
|
+
export { QUAC_SCHEMA_URL, declareQuacExtension, isNewerQuacMajor, listQuacExtension, readQuacVersion } from './model/quacExtension.ts';
|
|
75
|
+
export { generateServerStacCatalogue } from './generate/serverStacCatalogue.ts';
|
|
76
|
+
export { serverLayerTree } from './generate/serverLayerTree.ts';
|
|
77
|
+
export type { ServerLayerTree, ServerLayerTreeGroup, ServerLayerTreeLayer, ServerLayerTreeNode } from './generate/serverLayerTree.ts';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package's public API: everything an application imports from
|
|
3
|
+
* `@vectoriahq/quac`.
|
|
4
|
+
*/
|
|
5
|
+
export { STAC_VERSION } from "./model/Stac.js";
|
|
6
|
+
export { isIconLibraryAddress, resolveFieldIconAddress } from "./model/fieldIconAddress.js";
|
|
7
|
+
export { collectCollectionStyles, getDefaultStyle, styleAssetKey, GL_STYLE_MEDIA_TYPE } from "./model/stacStyles.js";
|
|
8
|
+
export { parseQgsXml } from "./parse/parseQgsXml.js";
|
|
9
|
+
export { measureFactorsOf } from "./parse/parseMeasurement.js";
|
|
10
|
+
export { readProjectXml } from "./parse/readProjectFile.js";
|
|
11
|
+
export { collectLayerVisibility } from "./parse/collectLayerVisibility.js";
|
|
12
|
+
export { parseDataSource } from "./parse/parseDataSource.js";
|
|
13
|
+
export { findGeometrySiblings, readGeometrySiblingShapes, readSiblingShapes, siblingCollectionId } from "./parse/geometrySiblings.js";
|
|
14
|
+
export { qmlForLayer } from "./generate/qmlForLayer.js";
|
|
15
|
+
export { generateStacCatalogue, parseQgisStyleAssetHref, isQgisPlaceholderDescription, QUAC_GEOMETRY_FILTER, QUAC_LAYER_NAME, readCollectionGeometryFilter, readCollectionLayerName } from "./generate/stacCatalogue.js";
|
|
16
|
+
export { DEFAULT_DELIMITED_TEXT_OPTIONS, QUAC_DELIMITED_TEXT, readCollectionDelimitedText } from "./model/delimitedText.js";
|
|
17
|
+
export { QUAC_FEATURE_FILTER, readCollectionFeatureFilter } from "./model/featureFilter.js";
|
|
18
|
+
export { decodeAssetPath, encodeAssetPath, isRelativeHref, readCollectionDataPath, readCollectionOnlineFile } from "./model/stacHref.js";
|
|
19
|
+
export { DATA_ROLE, findAssetByRole, readDataAsset } from "./model/stacAssetRoles.js";
|
|
20
|
+
export { THUMBNAIL_ROLE, readCollectionAttribution, readCollectionDeprecation, readCollectionSelfHref, readCollectionThumbnail } from "./model/stacCollectionNotes.js";
|
|
21
|
+
export { FILE_EXTENSION, FILE_SIZE_FIELD, TABLE_ROW_COUNT_FIELD, readCollectionRowCount, readDataAssetFileSize } from "./model/stacSizeAndCount.js";
|
|
22
|
+
export { PMTILES_MEDIA_TYPE, VISUAL_ROLE, readCollectionPmtiles } from "./model/stacPmtiles.js";
|
|
23
|
+
export { QUAC_ACTIVE_COLLECTION_FIELD, QUAC_FILTERS_FIELD, QUAC_FORM_ORDER_FIELD, QUAC_LOCKS_FIELD, QUAC_MUTUALLY_EXCLUSIVE_FIELD, QUAC_PRIVATE_FIELD, readCatalogueActiveCollection, readCatalogueInitialView, readCollectionDisplayField, readCollectionEditable, readCollectionFieldAliases, readCollectionFieldAttachments, readCollectionFieldEditRules, readCollectionFieldNames, readCollectionFieldTypes, readCollectionFieldValueRelations, readCollectionFieldValues, readCollectionFormLayout, readCollectionGeometryType, readCollectionIdentifiable, readCollectionMeasurement, readCollectionOpacity, readCollectionIcon, readCollectionLegendImage, readCollectionFilters, readCollectionLocks, readCollectionPrivate, readCollectionRelatedTo, readCollectionScaleRange, readCollectionVisibility, statedOpacity } from "./generate/normalizedProject.js";
|
|
24
|
+
export { generateStacCatalogueFromWfsCapabilities } from "./generate/wfsStacCatalogue.js";
|
|
25
|
+
export { generateStacCatalogueFromFolder } from "./generate/folderStacCatalogue.js";
|
|
26
|
+
export { generateCollectionForDroppedFile, generateCollectionForLinkedFile } from "./generate/fileLayerCollection.js";
|
|
27
|
+
export { generateStacCatalogueFromOgcCollections, resolveOgcCollectionSource } from "./generate/ogcFeaturesStacCatalogue.js";
|
|
28
|
+
export { generateStacCatalogueFromArcgisLayers, readArcgisCatalogueItemId, readArcgisNotShownReason, resolveArcgisCollectionSource } from "./generate/arcgisStacCatalogue.js";
|
|
29
|
+
export { normalizeExternalStacCatalogue, parseWfsGetFeatureUrl, resolveWfsCollectionSource } from "./generate/externalStacCatalogue.js";
|
|
30
|
+
export { decodeItemRowId, describeItem, encodeItemRowId, itemAsCollection, ITEMS_PAGE_SIZE, readItemsHref, readItemTimestamp, sortItemsNewestFirst } from "./sources/stacItems.js";
|
|
31
|
+
export { stripQgisServerQuery } from "./sources/qgisServerUrl.js";
|
|
32
|
+
export { parseGetProjectSettings } from "./parse/parseGetProjectSettings.js";
|
|
33
|
+
export { generateStacCatalogueFromWms } from "./generate/wmsStacCatalogue.js";
|
|
34
|
+
export { collectCatalogueCollections, listCatalogueChildren } from "./model/stacTreeWalk.js";
|
|
35
|
+
// Logging is off until the application using the package turns it on.
|
|
36
|
+
export { setDevLogging } from "./util/devLog.js";
|
|
37
|
+
export { WEB_MAP_LINKS_EXTENSION, buildWmsLink, readCollectionWms, wmsEndpoint } from "./model/stacWms.js";
|
|
38
|
+
export { readCollectionWmts, wmtsCapabilitiesUrl } from "./model/stacWmts.js";
|
|
39
|
+
export { VECTOR_TILE_MEDIA_TYPE, buildXyzLink, readCollectionXyzLink, readCollectionXyzTemplate } from "./model/stacXyz.js";
|
|
40
|
+
export { parseProjectMeasurement } from "./parse/parseMeasurement.js";
|
|
41
|
+
export { GEOMETRY_VALUES, LAYER_LOOKUP, QGIS_CONDITION, expressionToGeoStylerFunction, expressionToTemplate, isQgisConditionFilter, qgisConditionToFilter, readCurrentValueFields, readLayerLookups, readQgisExpression } from "./parse/qgisExpression.js";
|
|
42
|
+
export { formatQtDateTime, qtDatePart, readQtDateTime, splitQtDatePattern } from "./parse/qtDateFormat.js";
|
|
43
|
+
export { compileQtRegex, replaceQtRegex } from "./parse/qtRegex.js";
|
|
44
|
+
export { cloneCatalogShallow, collectAllCollections, resolveDocumentHrefs, withSelfLink } from "./sources/stacDocuments.js";
|
|
45
|
+
export { buildItemUrl, buildItemsPageUrl, readItem, readItemsPage } from "./sources/stacItems.js";
|
|
46
|
+
export { CATALOGUE_FILE_FORMATS, COG_MEDIA_TYPE, CSV_MEDIA_TYPE, declaredMediaTypeForFile, FLATGEOBUF_MEDIA_TYPE, GEOJSON_MEDIA_TYPE, GEOPACKAGE_MEDIA_TYPE, hasRole, isLayerFileOfFormat, PARQUET_MEDIA_TYPE, PROJECT_DATA_ROLES, QML_STYLE_MEDIA_TYPE } from "./util/catalogueFileFormats.js";
|
|
47
|
+
export { devLog } from "./util/devLog.js";
|
|
48
|
+
export { getFileNameFromPath, getLowerCaseExtension, getNormalisedFileBasename, getParentFolderPath } from "./util/fileName.js";
|
|
49
|
+
export { DEFAULT_WFS_VERSION, SPOKEN_WFS_VERSIONS, WFS_CAPABILITIES_VERSION, WFS_FALLBACK_VERSION } from "./util/wfsVersions.js";
|
|
50
|
+
export { QUAC_SCHEMA_URL, declareQuacExtension, isNewerQuacMajor, listQuacExtension, readQuacVersion } from "./model/quacExtension.js";
|
|
51
|
+
export { generateServerStacCatalogue } from "./generate/serverStacCatalogue.js";
|
|
52
|
+
export { serverLayerTree } from "./generate/serverLayerTree.js";
|