@honua/react 0.0.20-alpha.0 → 0.1.0-beta.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/contract/index.d.ts +2 -0
- package/contract/index.d.ts.map +1 -1
- package/contract/index.js +1 -0
- package/contract/pmtiles.d.ts +162 -0
- package/contract/pmtiles.d.ts.map +1 -0
- package/contract/pmtiles.js +155 -0
- package/contract/source.d.ts +24 -0
- package/contract/source.d.ts.map +1 -1
- package/contract/source.js +115 -8
- package/contract/types.d.ts +31 -2
- package/contract/types.d.ts.map +1 -1
- package/contract/types.js +8 -0
- package/core/auth/client-credentials-provider.d.ts +51 -0
- package/core/auth/client-credentials-provider.d.ts.map +1 -0
- package/core/auth/client-credentials-provider.js +115 -0
- package/core/auth/credential-store.d.ts +52 -0
- package/core/auth/credential-store.d.ts.map +1 -0
- package/core/auth/credential-store.js +82 -0
- package/core/auth/index.d.ts +23 -0
- package/core/auth/index.d.ts.map +1 -0
- package/core/auth/index.js +20 -0
- package/core/auth/oauth2-provider.d.ts +114 -0
- package/core/auth/oauth2-provider.d.ts.map +1 -0
- package/core/auth/oauth2-provider.js +408 -0
- package/core/auth/pkce.d.ts +25 -0
- package/core/auth/pkce.d.ts.map +1 -0
- package/core/auth/pkce.js +46 -0
- package/core/auth/static-providers.d.ts +20 -0
- package/core/auth/static-providers.d.ts.map +1 -0
- package/core/auth/static-providers.js +26 -0
- package/core/auth/token-endpoint.d.ts +40 -0
- package/core/auth/token-endpoint.d.ts.map +1 -0
- package/core/auth/token-endpoint.js +133 -0
- package/core/auth/types.d.ts +144 -0
- package/core/auth/types.d.ts.map +1 -0
- package/core/auth/types.js +8 -0
- package/core/client.d.ts +31 -1
- package/core/client.d.ts.map +1 -1
- package/core/client.js +52 -0
- package/core/errors.d.ts +33 -1
- package/core/errors.d.ts.map +1 -1
- package/core/errors.js +20 -0
- package/core/geoparquet-sql.d.ts +162 -0
- package/core/geoparquet-sql.d.ts.map +1 -0
- package/core/geoparquet-sql.js +333 -0
- package/core/ogc-endpoint-layout.d.ts +70 -0
- package/core/ogc-endpoint-layout.d.ts.map +1 -0
- package/core/ogc-endpoint-layout.js +173 -0
- package/core/ogc-features.d.ts.map +1 -1
- package/core/ogc-features.js +32 -17
- package/core/stac-static.d.ts +51 -0
- package/core/stac-static.d.ts.map +1 -0
- package/core/stac-static.js +195 -0
- package/core/stac.d.ts +12 -0
- package/core/stac.d.ts.map +1 -1
- package/core/stac.js +45 -15
- package/core/surfaces.d.ts +13 -0
- package/core/surfaces.d.ts.map +1 -1
- package/core/surfaces.js +58 -11
- package/core/types.d.ts +49 -0
- package/core/types.d.ts.map +1 -1
- package/core/wfs-capabilities.d.ts +10 -0
- package/core/wfs-capabilities.d.ts.map +1 -1
- package/core/wfs-capabilities.js +14 -2
- package/core/wfs.d.ts +13 -0
- package/core/wfs.d.ts.map +1 -1
- package/core/wfs.js +25 -5
- package/esri-compat/identity-manager.d.ts +43 -0
- package/esri-compat/identity-manager.d.ts.map +1 -1
- package/esri-compat/identity-manager.js +131 -1
- package/esri-compat/oauth-info.d.ts +15 -0
- package/esri-compat/oauth-info.d.ts.map +1 -1
- package/esri-compat/oauth-info.js +27 -0
- package/package.json +6 -1
- package/runtime/index.d.ts +2 -2
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +1 -4
- package/runtime/load-package.d.ts.map +1 -1
- package/runtime/load-package.js +8 -0
- package/runtime/map-package-validation.d.ts +0 -13
- package/runtime/map-package-validation.d.ts.map +1 -1
- package/runtime/map-package-validation.js +0 -12
- package/runtime/map-package.d.ts +1 -1
- package/runtime/map-package.d.ts.map +1 -1
- package/runtime/pmtiles-protocol.d.ts +77 -0
- package/runtime/pmtiles-protocol.d.ts.map +1 -0
- package/runtime/pmtiles-protocol.js +120 -0
- package/runtime/source-bridge.d.ts.map +1 -1
- package/runtime/source-bridge.js +27 -0
package/contract/index.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ export type { DefineQueryTileSourceOptions, QueryTileCacheIdentityDescriptor, Qu
|
|
|
56
56
|
export { ALL_CAPABILITIES, FIRST_PARTY_PROTOCOLS, createDataset, geoServicesFeatureSource, geoServicesGPServiceSource, geoServicesGeometryServiceSource, geoServicesImageSource, geoServicesMapServiceSource, odataSource, ogcFeaturesSource, ogcTilesSource, ogcMapsSource, ogcRecordsSource, stacSearchSource, wfsSource, wmsSource, wmtsSource, } from "./source.js";
|
|
57
57
|
export type { IJobRun, JobError, JobProgress, JobResult, JobResultsOptions, JobSnapshot, JobSnapshotListener, JobStatus, } from "./jobs.js";
|
|
58
58
|
export { HonuaJobPollTimeoutError, isJobTerminal } from "./jobs.js";
|
|
59
|
+
export { HonuaPmtilesArchive, describePmtilesArchive, stripPmtilesScheme, toPmtilesSourceUrl } from "./pmtiles.js";
|
|
60
|
+
export type { DescribePmtilesArchiveDeps, PmtilesArchiveDescription, PmtilesArchiveLike, PmtilesHeaderLike, PmtilesModuleLike, PmtilesRangeResponse, PmtilesSourceLike, PmtilesTileKind, PmtilesVectorLayerInfo, } from "./pmtiles.js";
|
|
59
61
|
export { TEMPORAL_CAPABILITY, TEMPORAL_ROUTE_PREFIX, TEMPORAL_ROUTES, TEMPORAL_SCHEMA_VERSION, assertValidTemporalRollbackPlanRequest, createTemporalClient, isReadOnlyTemporalHistory, temporalModeSupports, validateTemporalRollbackPlanRequest, } from "./temporal.js";
|
|
60
62
|
export type { TemporalAsOfRequest, TemporalAttributeChange, TemporalCheckpoint, TemporalChangeSet, TemporalChangeSetOperationKind, TemporalClient, TemporalClientCallOptions, TemporalContractFixture, TemporalCursor, TemporalCursorType, TemporalDiff, TemporalDiffRequest, TemporalDiffStatus, TemporalDiffSummary, TemporalError, TemporalErrorCode, TemporalFeatureChangeType, TemporalFeatureDiff, TemporalFeatureTimeline, TemporalFeatureTimelineRequest, TemporalFilter, TemporalGeometryChange, TemporalHistoryModel, TemporalJobRef, TemporalMode, TemporalRequestClient, TemporalRevision, TemporalRevisionOperation, TemporalRiskLevel, TemporalRollbackExecuteRequest, TemporalRollbackMode, TemporalRollbackOperation, TemporalRollbackPlan, TemporalRollbackPlanRequest, TemporalRollbackScope, TemporalRollbackStatus, TemporalSourceCapability, TemporalValidationIssue, } from "./temporal.js";
|
|
61
63
|
//# sourceMappingURL=index.d.ts.map
|
package/contract/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,YAAY,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,iCAAiC,EACjC,8BAA8B,EAC9B,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,cAAc,EACd,YAAY,EACZ,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,cAAc,EACd,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,MAAM,EACN,QAAQ,EACR,MAAM,EACN,2BAA2B,EAC3B,gBAAgB,EAChB,uBAAuB,EACvB,iCAAiC,EACjC,QAAQ,EACR,aAAa,EACb,cAAc,EACd,YAAY,EACZ,kCAAkC,GACnC,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,+BAA+B,EAC/B,gCAAgC,EAChC,qCAAqC,EACrC,+BAA+B,EAC/B,sBAAsB,EACtB,8BAA8B,EAC9B,iCAAiC,EACjC,kCAAkC,EAClC,4BAA4B,EAC5B,6BAA6B,EAC7B,iCAAi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AoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,wCAAwC,EACxC,8BAA8B,EAC9B,gCAAgC,EAChC,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,yBAAyB,EACzB,mCAAmC,EACnC,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,sBAAsB,EACtB,2BAA2B,EAC3B,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,YAAY,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,iCAAiC,EACjC,8BAA8B,EAC9B,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,cAAc,EACd,YAAY,EACZ,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,cAAc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EAClB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,sCAAsC,EACtC,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,mCAAmC,GACpC,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,8BAA8B,EAC9B,cAAc,EACd,yBAAyB,EACzB,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,uBAAuB,EACvB,8BAA8B,EAC9B,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,iBAAiB,EACjB,8BAA8B,EAC9B,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,eAAe,CAAC"}
|
package/contract/index.js
CHANGED
|
@@ -48,4 +48,5 @@ export { FEATURE_SERVER_H3_SPATIAL_AGGREGATION_INDEX_MODEL_ID, SPATIAL_AGGREGATI
|
|
|
48
48
|
export { QUERY_TILE_SERVER_CONTRACT_VERSION, QUERY_TILE_SERVER_FEATURE_DETAIL_ROUTE_TEMPLATE, QUERY_TILE_SERVER_RESPONSE_HEADERS, QUERY_TILE_SERVER_ROUTE_PREFIX, QUERY_TILE_SERVER_SOURCE_ROUTE_TEMPLATE, QUERY_TILE_SERVER_TILEJSON_ROUTE_TEMPLATE, QUERY_TILE_SERVER_TILE_ROUTE_TEMPLATE, buildQueryTileCacheKey, buildQueryTileFeatureDetailQuery, buildQueryTileServerPath, buildQueryTileServerUrl, defineQueryTileSource, loadQueryTileFeatureDetail, mapQueryTileFeatureIdentity, normalizeQueryTileKey, normalizeQueryTileSourceDescriptor, parseQueryTileFeatureDetailResponse, parseQueryTileJson, parseQueryTileServerErrorResponse, queryTileServerRequestParamsFromDescriptor, queryTileKeyString, stableJson, } from "./tiles.js";
|
|
49
49
|
export { ALL_CAPABILITIES, FIRST_PARTY_PROTOCOLS, createDataset, geoServicesFeatureSource, geoServicesGPServiceSource, geoServicesGeometryServiceSource, geoServicesImageSource, geoServicesMapServiceSource, odataSource, ogcFeaturesSource, ogcTilesSource, ogcMapsSource, ogcRecordsSource, stacSearchSource, wfsSource, wmsSource, wmtsSource, } from "./source.js";
|
|
50
50
|
export { HonuaJobPollTimeoutError, isJobTerminal } from "./jobs.js";
|
|
51
|
+
export { HonuaPmtilesArchive, describePmtilesArchive, stripPmtilesScheme, toPmtilesSourceUrl } from "./pmtiles.js";
|
|
51
52
|
export { TEMPORAL_CAPABILITY, TEMPORAL_ROUTE_PREFIX, TEMPORAL_ROUTES, TEMPORAL_SCHEMA_VERSION, assertValidTemporalRollbackPlanRequest, createTemporalClient, isReadOnlyTemporalHistory, temporalModeSupports, validateTemporalRollbackPlanRequest, } from "./temporal.js";
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PMTiles archive inspection for the protocol-neutral contract.
|
|
3
|
+
*
|
|
4
|
+
* A PMTiles archive is a single, immutable file (on object storage or any
|
|
5
|
+
* static host) that stores an entire raster or vector tile pyramid. It
|
|
6
|
+
* participates in the `Dataset` / `Source` model as a **tiles-only** protocol:
|
|
7
|
+
* the canonical query family throws {@link HonuaCapabilityNotSupportedError}
|
|
8
|
+
* (there is no feature-query surface on an archive), while archive metadata —
|
|
9
|
+
* bounds, min/max zoom, and vector layer names — is inspected through
|
|
10
|
+
* `Source.protocol("pmtiles").describe()`.
|
|
11
|
+
*
|
|
12
|
+
* This module never statically imports the `pmtiles` package. The reader is
|
|
13
|
+
* pulled in lazily (`await import("pmtiles")`) the first time an archive is
|
|
14
|
+
* actually described, mirroring the Cesium adapter so consumers that never
|
|
15
|
+
* touch PMTiles pay zero bundle cost. A minimal `pmtiles` module slice is
|
|
16
|
+
* modelled here so the wiring stays unit-testable against an injected fake
|
|
17
|
+
* without a network fetch.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Canonical tile-payload kinds a PMTiles archive can store. `mvt` is a vector
|
|
23
|
+
* archive (Mapbox Vector Tiles); the rest are raster encodings. `unknown`
|
|
24
|
+
* covers archives whose header tile-type byte the reader could not classify.
|
|
25
|
+
*/
|
|
26
|
+
export type PmtilesTileKind = "mvt" | "png" | "jpeg" | "webp" | "avif" | "unknown";
|
|
27
|
+
/**
|
|
28
|
+
* One vector layer advertised in a vector archive's TileJSON-style metadata
|
|
29
|
+
* (`vector_layers`). Present only for `mvt` archives; raster archives report an
|
|
30
|
+
* empty {@link PmtilesArchiveDescription.vectorLayers} list.
|
|
31
|
+
*/
|
|
32
|
+
export interface PmtilesVectorLayerInfo {
|
|
33
|
+
/** Layer id — the MapLibre `source-layer` name to reference in a style. */
|
|
34
|
+
readonly id: string;
|
|
35
|
+
/** Optional human description carried in the archive metadata. */
|
|
36
|
+
readonly description?: string;
|
|
37
|
+
/** Optional per-layer minimum zoom advertised in the metadata. */
|
|
38
|
+
readonly minZoom?: number;
|
|
39
|
+
/** Optional per-layer maximum zoom advertised in the metadata. */
|
|
40
|
+
readonly maxZoom?: number;
|
|
41
|
+
/** Optional field-name → type map advertised in the metadata. */
|
|
42
|
+
readonly fields?: Readonly<Record<string, string>>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The archive metadata surfaced by {@link describePmtilesArchive}. Bounds are
|
|
46
|
+
* `[west, south, east, north]` in degrees; `center` is `[lon, lat, zoom]`. The
|
|
47
|
+
* raw metadata JSON is preserved on `metadata` for callers that need archive
|
|
48
|
+
* fields beyond the normalized shape.
|
|
49
|
+
*/
|
|
50
|
+
export interface PmtilesArchiveDescription {
|
|
51
|
+
/** Archive URL the description was read from. */
|
|
52
|
+
readonly url: string;
|
|
53
|
+
/** Tile payload kind stored in the archive. */
|
|
54
|
+
readonly tileKind: PmtilesTileKind;
|
|
55
|
+
/** Geographic bounds `[west, south, east, north]` in degrees. */
|
|
56
|
+
readonly bounds: readonly [number, number, number, number];
|
|
57
|
+
/** Lowest zoom level present in the archive. */
|
|
58
|
+
readonly minZoom: number;
|
|
59
|
+
/** Highest zoom level present in the archive. */
|
|
60
|
+
readonly maxZoom: number;
|
|
61
|
+
/** Suggested view center `[lon, lat, zoom]`. */
|
|
62
|
+
readonly center: readonly [number, number, number];
|
|
63
|
+
/** Vector layer definitions (empty for raster archives). */
|
|
64
|
+
readonly vectorLayers: readonly PmtilesVectorLayerInfo[];
|
|
65
|
+
/** Attribution string advertised in the archive metadata, when present. */
|
|
66
|
+
readonly attribution?: string;
|
|
67
|
+
/** The raw, parsed archive metadata JSON. */
|
|
68
|
+
readonly metadata: Readonly<Record<string, unknown>>;
|
|
69
|
+
}
|
|
70
|
+
/** A byte-range response from a {@link PmtilesSourceLike}. */
|
|
71
|
+
export interface PmtilesRangeResponse {
|
|
72
|
+
readonly data: ArrayBuffer;
|
|
73
|
+
readonly etag?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The `pmtiles` `Source` surface — a byte-range reader over the archive. A
|
|
77
|
+
* remote archive uses the reader's own `FetchSource`; a local fixture (tests)
|
|
78
|
+
* supplies a buffer-backed implementation.
|
|
79
|
+
*/
|
|
80
|
+
export interface PmtilesSourceLike {
|
|
81
|
+
getBytes(offset: number, length: number, signal?: AbortSignal, etag?: string): Promise<PmtilesRangeResponse>;
|
|
82
|
+
getKey(): string;
|
|
83
|
+
}
|
|
84
|
+
/** The `Header` fields this module reads (a subset of `pmtiles.Header`). */
|
|
85
|
+
export interface PmtilesHeaderLike {
|
|
86
|
+
readonly minZoom: number;
|
|
87
|
+
readonly maxZoom: number;
|
|
88
|
+
readonly minLon: number;
|
|
89
|
+
readonly minLat: number;
|
|
90
|
+
readonly maxLon: number;
|
|
91
|
+
readonly maxLat: number;
|
|
92
|
+
readonly centerZoom: number;
|
|
93
|
+
readonly centerLon: number;
|
|
94
|
+
readonly centerLat: number;
|
|
95
|
+
readonly tileType: number;
|
|
96
|
+
}
|
|
97
|
+
/** The `PMTiles` reader surface this module drives. */
|
|
98
|
+
export interface PmtilesArchiveLike {
|
|
99
|
+
getHeader(): Promise<PmtilesHeaderLike>;
|
|
100
|
+
getMetadata(): Promise<unknown>;
|
|
101
|
+
}
|
|
102
|
+
/** The minimal slice of `typeof import("pmtiles")` the describe path needs. */
|
|
103
|
+
export interface PmtilesModuleLike {
|
|
104
|
+
new (source: PmtilesSourceLike | string): PmtilesArchiveLike;
|
|
105
|
+
}
|
|
106
|
+
/** Injectable dependencies for {@link describePmtilesArchive} (test seams). */
|
|
107
|
+
export interface DescribePmtilesArchiveDeps {
|
|
108
|
+
/** Override the lazily-imported `pmtiles.PMTiles` constructor. */
|
|
109
|
+
readonly PMTiles?: PmtilesModuleLike;
|
|
110
|
+
/** Read from a local/in-memory source instead of fetching `url`. */
|
|
111
|
+
readonly source?: PmtilesSourceLike;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Inspect a PMTiles archive and return its normalized metadata (bounds, min/max
|
|
115
|
+
* zoom, suggested center, and vector layer names). The `pmtiles` reader is
|
|
116
|
+
* imported lazily on first use.
|
|
117
|
+
*
|
|
118
|
+
* Pass {@link DescribePmtilesArchiveDeps.source} to read a local archive (the
|
|
119
|
+
* unit-test path) or {@link DescribePmtilesArchiveDeps.PMTiles} to inject a fake
|
|
120
|
+
* reader; both default to fetching `url` through the real reader.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const info = await describePmtilesArchive("https://example.com/basemap.pmtiles");
|
|
125
|
+
* console.log(info.bounds, info.minZoom, info.maxZoom);
|
|
126
|
+
* for (const layer of info.vectorLayers) console.log(layer.id);
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export declare function describePmtilesArchive(url: string, deps?: DescribePmtilesArchiveDeps): Promise<PmtilesArchiveDescription>;
|
|
130
|
+
/**
|
|
131
|
+
* Typed adapter handle for a PMTiles archive, reachable through
|
|
132
|
+
* `Source.protocol("pmtiles")`. Provides the archive-metadata inspection
|
|
133
|
+
* surface ({@link HonuaPmtilesArchive.describe}) that the tiles-only PMTiles
|
|
134
|
+
* `Source` uses to participate in the Dataset model honestly. The first
|
|
135
|
+
* `describe()` call is cached so repeated inspection does not re-open the
|
|
136
|
+
* archive.
|
|
137
|
+
*/
|
|
138
|
+
export declare class HonuaPmtilesArchive {
|
|
139
|
+
#private;
|
|
140
|
+
/** The `pmtiles://`-free archive URL this handle inspects. */
|
|
141
|
+
readonly url: string;
|
|
142
|
+
constructor(url: string, deps?: DescribePmtilesArchiveDeps);
|
|
143
|
+
/**
|
|
144
|
+
* Inspect the archive and return its normalized metadata. Cached after the
|
|
145
|
+
* first successful call; a failed inspection is not cached so a transient
|
|
146
|
+
* fetch error can be retried.
|
|
147
|
+
*/
|
|
148
|
+
describe(): Promise<PmtilesArchiveDescription>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Strip a leading `pmtiles://` scheme from an archive URL, if present. MapLibre
|
|
152
|
+
* style sources address PMTiles archives as `pmtiles://https://…`; the reader
|
|
153
|
+
* (and this contract's describe path) want the bare archive URL.
|
|
154
|
+
*/
|
|
155
|
+
export declare function stripPmtilesScheme(url: string): string;
|
|
156
|
+
/**
|
|
157
|
+
* Add the `pmtiles://` scheme to a bare archive URL if it is not already
|
|
158
|
+
* present. The inverse of {@link stripPmtilesScheme}; use it when composing a
|
|
159
|
+
* MapLibre source `url` from a plain archive locator.
|
|
160
|
+
*/
|
|
161
|
+
export declare function toPmtilesSourceUrl(url: string): string;
|
|
162
|
+
//# sourceMappingURL=pmtiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pmtiles.d.ts","sourceRoot":"","sources":["../../../src/contract/pmtiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEnF;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,iDAAiD;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3D,gDAAgD;IAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAA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AW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC;AAED,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,KAAK,MAAM,EAAE,iBAAiB,GAAG,MAAM,GAAG,kBAAkB,CAAC;CAC9D;AAED,+EAA+E;AAC/E,MAAM,WAAW,0BAA0B;IACzC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IACrC,oEAAoE;IACpE,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC;CACrC;AA4DD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,0BAA+B,GACpC,OAAO,CAAC,yBAAyB,CAAC,CAkBpC;AAED;;;;;;;GAOG;AACH,qBAAa,mBAAmB;;IAC9B,8DAA8D;IAC9D,SAAgB,GAAG,EAAE,MAAM,CAAC;gBAIT,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,0BAA+B;IAKrE;;;;OAIG;IACI,QAAQ,IAAI,OAAO,CAAC,yBAAyB,CAAC;CAStD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PMTiles archive inspection for the protocol-neutral contract.
|
|
3
|
+
*
|
|
4
|
+
* A PMTiles archive is a single, immutable file (on object storage or any
|
|
5
|
+
* static host) that stores an entire raster or vector tile pyramid. It
|
|
6
|
+
* participates in the `Dataset` / `Source` model as a **tiles-only** protocol:
|
|
7
|
+
* the canonical query family throws {@link HonuaCapabilityNotSupportedError}
|
|
8
|
+
* (there is no feature-query surface on an archive), while archive metadata —
|
|
9
|
+
* bounds, min/max zoom, and vector layer names — is inspected through
|
|
10
|
+
* `Source.protocol("pmtiles").describe()`.
|
|
11
|
+
*
|
|
12
|
+
* This module never statically imports the `pmtiles` package. The reader is
|
|
13
|
+
* pulled in lazily (`await import("pmtiles")`) the first time an archive is
|
|
14
|
+
* actually described, mirroring the Cesium adapter so consumers that never
|
|
15
|
+
* touch PMTiles pay zero bundle cost. A minimal `pmtiles` module slice is
|
|
16
|
+
* modelled here so the wiring stays unit-testable against an injected fake
|
|
17
|
+
* without a network fetch.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Lazily import the `pmtiles` reader. Kept in its own function so the dynamic
|
|
23
|
+
* `import("pmtiles")` is the only reference to the package in `src/`, which is
|
|
24
|
+
* what keeps PMTiles out of every bundle that never inspects an archive.
|
|
25
|
+
*/
|
|
26
|
+
async function loadPmtilesCtor() {
|
|
27
|
+
const mod = (await import("pmtiles"));
|
|
28
|
+
return mod.PMTiles;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The `pmtiles` `TileType` enum values (spec v3). Duplicated here as a plain
|
|
32
|
+
* map so classification does not force a value import of the package.
|
|
33
|
+
*/
|
|
34
|
+
const TILE_KIND_BY_TYPE = {
|
|
35
|
+
0: "unknown",
|
|
36
|
+
1: "mvt",
|
|
37
|
+
2: "png",
|
|
38
|
+
3: "jpeg",
|
|
39
|
+
4: "webp",
|
|
40
|
+
5: "avif",
|
|
41
|
+
};
|
|
42
|
+
function tileKindFromHeader(tileType) {
|
|
43
|
+
return TILE_KIND_BY_TYPE[tileType] ?? "unknown";
|
|
44
|
+
}
|
|
45
|
+
function readVectorLayers(metadata) {
|
|
46
|
+
const raw = metadata.vector_layers;
|
|
47
|
+
if (!Array.isArray(raw))
|
|
48
|
+
return [];
|
|
49
|
+
const layers = [];
|
|
50
|
+
for (const entry of raw) {
|
|
51
|
+
if (!entry || typeof entry !== "object")
|
|
52
|
+
continue;
|
|
53
|
+
const record = entry;
|
|
54
|
+
const id = record.id;
|
|
55
|
+
if (typeof id !== "string" || id === "")
|
|
56
|
+
continue;
|
|
57
|
+
const info = { id };
|
|
58
|
+
if (typeof record.description === "string")
|
|
59
|
+
info.description = record.description;
|
|
60
|
+
if (typeof record.minzoom === "number")
|
|
61
|
+
info.minZoom = record.minzoom;
|
|
62
|
+
if (typeof record.maxzoom === "number")
|
|
63
|
+
info.maxZoom = record.maxzoom;
|
|
64
|
+
if (record.fields && typeof record.fields === "object") {
|
|
65
|
+
info.fields = record.fields;
|
|
66
|
+
}
|
|
67
|
+
layers.push(info);
|
|
68
|
+
}
|
|
69
|
+
return layers;
|
|
70
|
+
}
|
|
71
|
+
function asMetadataRecord(metadata) {
|
|
72
|
+
return metadata && typeof metadata === "object" ? metadata : {};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Inspect a PMTiles archive and return its normalized metadata (bounds, min/max
|
|
76
|
+
* zoom, suggested center, and vector layer names). The `pmtiles` reader is
|
|
77
|
+
* imported lazily on first use.
|
|
78
|
+
*
|
|
79
|
+
* Pass {@link DescribePmtilesArchiveDeps.source} to read a local archive (the
|
|
80
|
+
* unit-test path) or {@link DescribePmtilesArchiveDeps.PMTiles} to inject a fake
|
|
81
|
+
* reader; both default to fetching `url` through the real reader.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const info = await describePmtilesArchive("https://example.com/basemap.pmtiles");
|
|
86
|
+
* console.log(info.bounds, info.minZoom, info.maxZoom);
|
|
87
|
+
* for (const layer of info.vectorLayers) console.log(layer.id);
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export async function describePmtilesArchive(url, deps = {}) {
|
|
91
|
+
const PMTiles = deps.PMTiles ?? (await loadPmtilesCtor());
|
|
92
|
+
const archive = deps.source ? new PMTiles(deps.source) : new PMTiles(url);
|
|
93
|
+
const [header, rawMetadata] = await Promise.all([archive.getHeader(), archive.getMetadata()]);
|
|
94
|
+
const metadata = asMetadataRecord(rawMetadata);
|
|
95
|
+
const attribution = typeof metadata.attribution === "string" ? metadata.attribution : undefined;
|
|
96
|
+
return {
|
|
97
|
+
url,
|
|
98
|
+
tileKind: tileKindFromHeader(header.tileType),
|
|
99
|
+
bounds: [header.minLon, header.minLat, header.maxLon, header.maxLat],
|
|
100
|
+
minZoom: header.minZoom,
|
|
101
|
+
maxZoom: header.maxZoom,
|
|
102
|
+
center: [header.centerLon, header.centerLat, header.centerZoom],
|
|
103
|
+
vectorLayers: readVectorLayers(metadata),
|
|
104
|
+
...(attribution ? { attribution } : {}),
|
|
105
|
+
metadata,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Typed adapter handle for a PMTiles archive, reachable through
|
|
110
|
+
* `Source.protocol("pmtiles")`. Provides the archive-metadata inspection
|
|
111
|
+
* surface ({@link HonuaPmtilesArchive.describe}) that the tiles-only PMTiles
|
|
112
|
+
* `Source` uses to participate in the Dataset model honestly. The first
|
|
113
|
+
* `describe()` call is cached so repeated inspection does not re-open the
|
|
114
|
+
* archive.
|
|
115
|
+
*/
|
|
116
|
+
export class HonuaPmtilesArchive {
|
|
117
|
+
/** The `pmtiles://`-free archive URL this handle inspects. */
|
|
118
|
+
url;
|
|
119
|
+
#deps;
|
|
120
|
+
#description;
|
|
121
|
+
constructor(url, deps = {}) {
|
|
122
|
+
this.url = url;
|
|
123
|
+
this.#deps = deps;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Inspect the archive and return its normalized metadata. Cached after the
|
|
127
|
+
* first successful call; a failed inspection is not cached so a transient
|
|
128
|
+
* fetch error can be retried.
|
|
129
|
+
*/
|
|
130
|
+
describe() {
|
|
131
|
+
if (!this.#description) {
|
|
132
|
+
this.#description = describePmtilesArchive(this.url, this.#deps).catch((error) => {
|
|
133
|
+
this.#description = undefined;
|
|
134
|
+
throw error;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return this.#description;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Strip a leading `pmtiles://` scheme from an archive URL, if present. MapLibre
|
|
142
|
+
* style sources address PMTiles archives as `pmtiles://https://…`; the reader
|
|
143
|
+
* (and this contract's describe path) want the bare archive URL.
|
|
144
|
+
*/
|
|
145
|
+
export function stripPmtilesScheme(url) {
|
|
146
|
+
return url.startsWith("pmtiles://") ? url.slice("pmtiles://".length) : url;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Add the `pmtiles://` scheme to a bare archive URL if it is not already
|
|
150
|
+
* present. The inverse of {@link stripPmtilesScheme}; use it when composing a
|
|
151
|
+
* MapLibre source `url` from a plain archive locator.
|
|
152
|
+
*/
|
|
153
|
+
export function toPmtilesSourceUrl(url) {
|
|
154
|
+
return url.startsWith("pmtiles://") ? url : `pmtiles://${url}`;
|
|
155
|
+
}
|
package/contract/source.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { HonuaFeatureLayer, HonuaGeometryService, HonuaGeoprocessingService, Hon
|
|
|
23
23
|
import { HonuaWfsFeatureType } from "../core/wfs.js";
|
|
24
24
|
import { HonuaWms, HonuaWmsLayer } from "../core/wms.js";
|
|
25
25
|
import { HonuaWmts, HonuaWmtsLayer, HonuaWmtsTileset } from "../core/wmts.js";
|
|
26
|
+
import { HonuaPmtilesArchive } from "./pmtiles.js";
|
|
26
27
|
import { type Capability, type CapabilityPolicy, type CreateDatasetOptions, type Dataset, type Protocol, type Source, type SourceDescriptor } from "./types.js";
|
|
27
28
|
/**
|
|
28
29
|
* Construct a protocol-neutral `Dataset` over a `HonuaClient`.
|
|
@@ -216,6 +217,28 @@ export declare function geoServicesGPServiceSource<T>(descriptor: SourceDescript
|
|
|
216
217
|
* ```
|
|
217
218
|
*/
|
|
218
219
|
export declare function ogcTilesSource<T>(descriptor: SourceDescriptor, client: HonuaClient, policy: CapabilityPolicy): Source<T>;
|
|
220
|
+
/**
|
|
221
|
+
* Tiles-only Source adapter for a PMTiles archive (`protocol: "pmtiles"`).
|
|
222
|
+
*
|
|
223
|
+
* PMTiles archives are immutable single-file tile stores, so the canonical
|
|
224
|
+
* query family throws `HonuaCapabilityNotSupportedError` (there is no
|
|
225
|
+
* feature-query surface on an archive). Archive metadata — bounds, min/max
|
|
226
|
+
* zoom, and vector layer names — is inspected through the typed escape hatch:
|
|
227
|
+
* `Source.protocol("pmtiles").describe()`. Rendering integrations register the
|
|
228
|
+
* `pmtiles://` protocol on the map (see `@honua/sdk-js/runtime`) and reference
|
|
229
|
+
* the archive as a MapLibre source `url`.
|
|
230
|
+
*
|
|
231
|
+
* `locator.url` may carry a leading `pmtiles://` scheme (the MapLibre form) or
|
|
232
|
+
* be a bare archive URL; both resolve to the same archive.
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```ts
|
|
236
|
+
* const archive = dataset.source("basemap")!.protocol("pmtiles");
|
|
237
|
+
* const info = await archive!.describe();
|
|
238
|
+
* console.log(info.bounds, info.vectorLayers.map((layer) => layer.id));
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
export declare function pmtilesSource<T>(descriptor: SourceDescriptor, _client: HonuaClient, policy: CapabilityPolicy): Source<T>;
|
|
219
242
|
/**
|
|
220
243
|
* Render-only Source adapter for OGC API Maps. Same shape as the Tiles
|
|
221
244
|
* adapter — `Source.protocol("ogc-maps")` exposes the runtime class for
|
|
@@ -414,6 +437,7 @@ declare module "./types.js" {
|
|
|
414
437
|
"wmts-layer": HonuaWmtsLayer;
|
|
415
438
|
"wmts-tileset": HonuaWmtsTileset;
|
|
416
439
|
odata: HonuaOdataEntitySet;
|
|
440
|
+
pmtiles: HonuaPmtilesArchive;
|
|
417
441
|
}
|
|
418
442
|
}
|
|
419
443
|
/** Sentinel: `Capabilities` set that contains every defined capability. */
|
package/contract/source.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/contract/source.ts"],"names":[],"mappings":"AA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aAAa,CAAC;QAC3B,IAAI,EAAE,SAAS,CAAC;QAChB,YAAY,EAAE,cAAc,CAAC;QAC7B,cAAc,EAAE,gBAAgB,CAAC;QACjC,KAAK,EAAE,mBAAmB,CAAC;QAC3B,OAAO,EAAE,mBAAmB,CAAC;KAC9B;CACF;AAID,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,UAAU,CAAyB,CAAC;AAE/E,iEAAiE;AACjE,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,QAAQ,CAe7C,CAAC"}
|
package/contract/source.js
CHANGED
|
@@ -18,12 +18,14 @@ import { HonuaOgcCollectionMap, HonuaOgcMaps } from "../core/ogc-maps.js";
|
|
|
18
18
|
import { HonuaOgcRecordCollection } from "../core/ogc-records.js";
|
|
19
19
|
import { HonuaOgcTiles, HonuaOgcTileset } from "../core/ogc-tiles.js";
|
|
20
20
|
import { trimTrailingSlashes } from "../core/path-utils.js";
|
|
21
|
+
import { HonuaStacStaticCatalog } from "../core/stac-static.js";
|
|
21
22
|
import { HonuaStacSearch } from "../core/stac.js";
|
|
22
23
|
import { HonuaFeatureLayer, HonuaGeometryService, HonuaGeoprocessingService, HonuaImageService, HonuaMapLayer, HonuaMapService, HonuaOgcFeatureCollection, HonuaOgcFeatures, } from "../core/surfaces.js";
|
|
23
24
|
import { UNSUPPORTED_FES, compileSpatialFilter, compileWhere, geoJsonGeometryToGml, serializeFes, } from "../core/wfs-filter.js";
|
|
24
25
|
import { HonuaWfs, HonuaWfsFeatureType } from "../core/wfs.js";
|
|
25
26
|
import { HonuaWms, HonuaWmsLayer, parseWmsLayerNames } from "../core/wms.js";
|
|
26
27
|
import { HonuaWmts, HonuaWmtsLayer, HonuaWmtsTileset } from "../core/wmts.js";
|
|
28
|
+
import { HonuaPmtilesArchive, stripPmtilesScheme } from "./pmtiles.js";
|
|
27
29
|
import { CAPABILITIES, PROTOCOL_DEFAULT_CAPABILITIES, } from "./types.js";
|
|
28
30
|
/**
|
|
29
31
|
* Construct a protocol-neutral `Dataset` over a `HonuaClient`.
|
|
@@ -161,6 +163,8 @@ function buildBuiltInSource(descriptor, client, policy) {
|
|
|
161
163
|
return wfsSource(descriptor, client, policy);
|
|
162
164
|
case "odata":
|
|
163
165
|
return odataSource(descriptor, client, policy);
|
|
166
|
+
case "pmtiles":
|
|
167
|
+
return pmtilesSource(descriptor, client, policy);
|
|
164
168
|
default:
|
|
165
169
|
return undefined;
|
|
166
170
|
}
|
|
@@ -378,8 +382,13 @@ export function geoServicesMapServiceSource(descriptor, client, policy) {
|
|
|
378
382
|
*/
|
|
379
383
|
export function ogcFeaturesSource(descriptor, client, policy) {
|
|
380
384
|
const { collectionId } = requireOgcLocator(descriptor);
|
|
381
|
-
const
|
|
382
|
-
const
|
|
385
|
+
const layoutMode = ogcFeaturesLayoutMode(descriptor.locator.layout);
|
|
386
|
+
const collection = new HonuaOgcFeatureCollection({
|
|
387
|
+
client,
|
|
388
|
+
collectionId,
|
|
389
|
+
...(layoutMode ? { layout: layoutMode } : {}),
|
|
390
|
+
});
|
|
391
|
+
const root = new HonuaOgcFeatures({ client, ...(layoutMode ? { layout: layoutMode } : {}) });
|
|
383
392
|
const caps = descriptor.capabilities ?? PROTOCOL_DEFAULT_CAPABILITIES["ogc-features"];
|
|
384
393
|
const adapterRegistry = {
|
|
385
394
|
"ogc-features": collection,
|
|
@@ -763,6 +772,37 @@ export function ogcTilesSource(descriptor, client, policy) {
|
|
|
763
772
|
};
|
|
764
773
|
return makeSource(descriptor, caps, policy, adapterRegistry, unsupportedFeatureSurface(descriptor));
|
|
765
774
|
}
|
|
775
|
+
// ── PMTiles archive ───────────────────────────────────────────
|
|
776
|
+
/**
|
|
777
|
+
* Tiles-only Source adapter for a PMTiles archive (`protocol: "pmtiles"`).
|
|
778
|
+
*
|
|
779
|
+
* PMTiles archives are immutable single-file tile stores, so the canonical
|
|
780
|
+
* query family throws `HonuaCapabilityNotSupportedError` (there is no
|
|
781
|
+
* feature-query surface on an archive). Archive metadata — bounds, min/max
|
|
782
|
+
* zoom, and vector layer names — is inspected through the typed escape hatch:
|
|
783
|
+
* `Source.protocol("pmtiles").describe()`. Rendering integrations register the
|
|
784
|
+
* `pmtiles://` protocol on the map (see `@honua/sdk-js/runtime`) and reference
|
|
785
|
+
* the archive as a MapLibre source `url`.
|
|
786
|
+
*
|
|
787
|
+
* `locator.url` may carry a leading `pmtiles://` scheme (the MapLibre form) or
|
|
788
|
+
* be a bare archive URL; both resolve to the same archive.
|
|
789
|
+
*
|
|
790
|
+
* @example
|
|
791
|
+
* ```ts
|
|
792
|
+
* const archive = dataset.source("basemap")!.protocol("pmtiles");
|
|
793
|
+
* const info = await archive!.describe();
|
|
794
|
+
* console.log(info.bounds, info.vectorLayers.map((layer) => layer.id));
|
|
795
|
+
* ```
|
|
796
|
+
*/
|
|
797
|
+
export function pmtilesSource(descriptor, _client, policy) {
|
|
798
|
+
const url = stripPmtilesScheme(requirePmtilesLocator(descriptor));
|
|
799
|
+
const caps = descriptor.capabilities ?? PROTOCOL_DEFAULT_CAPABILITIES.pmtiles;
|
|
800
|
+
const archive = new HonuaPmtilesArchive(url);
|
|
801
|
+
const adapterRegistry = {
|
|
802
|
+
pmtiles: archive,
|
|
803
|
+
};
|
|
804
|
+
return makeSource(descriptor, caps, policy, adapterRegistry, unsupportedFeatureSurface(descriptor));
|
|
805
|
+
}
|
|
766
806
|
// ── OGC API Maps ──────────────────────────────────────────────
|
|
767
807
|
/**
|
|
768
808
|
* Render-only Source adapter for OGC API Maps. Same shape as the Tiles
|
|
@@ -1074,7 +1114,14 @@ export function wmtsSource(descriptor, client, policy) {
|
|
|
1074
1114
|
* ```
|
|
1075
1115
|
*/
|
|
1076
1116
|
export function stacSearchSource(descriptor, client, policy) {
|
|
1077
|
-
|
|
1117
|
+
// Endpoint-layout selection. `stac-api` treats `locator.url` as a raw STAC
|
|
1118
|
+
// API root (search / collections mounted directly under it) rather than the
|
|
1119
|
+
// Honua `/stac` facade. `stac-static` reads a static catalog.json tree with
|
|
1120
|
+
// no search endpoint. Omitted / `honua-facade` keeps the `/stac` facade.
|
|
1121
|
+
const layout = descriptor.locator.layout;
|
|
1122
|
+
const stacBasePath = layout === "stac-api" ? "" : undefined;
|
|
1123
|
+
const stac = new HonuaStacSearch({ client, ...(stacBasePath !== undefined ? { basePath: stacBasePath } : {}) });
|
|
1124
|
+
const staticCatalog = layout === "stac-static" ? new HonuaStacStaticCatalog(client, client.serverBaseUrl) : undefined;
|
|
1078
1125
|
const caps = descriptor.capabilities ?? PROTOCOL_DEFAULT_CAPABILITIES.stac;
|
|
1079
1126
|
const collectionScope = descriptor.locator.collectionId;
|
|
1080
1127
|
const adapterRegistry = {
|
|
@@ -1087,7 +1134,9 @@ export function stacSearchSource(descriptor, client, policy) {
|
|
|
1087
1134
|
throw new HonuaCapabilityNotSupportedError("queryAggregate", descriptor.protocol, descriptor.id);
|
|
1088
1135
|
}
|
|
1089
1136
|
const stacRequest = toStacRequest(request, collectionScope);
|
|
1090
|
-
const response =
|
|
1137
|
+
const response = staticCatalog
|
|
1138
|
+
? await staticCatalog.search(toStacStaticParams(stacRequest))
|
|
1139
|
+
: await stac.search(stacRequest);
|
|
1091
1140
|
const features = (response.features ?? []).map((toTypedFeatureFromStac));
|
|
1092
1141
|
const totalCount = response.numberMatched ?? response.context?.matched;
|
|
1093
1142
|
const exceededTransferLimit = totalCount !== undefined && features.length < totalCount;
|
|
@@ -1100,6 +1149,12 @@ export function stacSearchSource(descriptor, client, policy) {
|
|
|
1100
1149
|
async queryAll(request) {
|
|
1101
1150
|
ensureCapability(descriptor, caps, "query");
|
|
1102
1151
|
const limit = request?.pagination?.limit;
|
|
1152
|
+
if (staticCatalog) {
|
|
1153
|
+
const response = await staticCatalog.search(toStacStaticParams(toStacRequest(request, collectionScope)));
|
|
1154
|
+
const typed = (response.features ?? []).map((toTypedFeatureFromStac));
|
|
1155
|
+
const { features, exceededTransferLimit } = applyQueryAllLimit(typed, limit);
|
|
1156
|
+
return { features, exceededTransferLimit, totalCount: features.length };
|
|
1157
|
+
}
|
|
1103
1158
|
const items = await stac.searchAll({
|
|
1104
1159
|
...toStacRequest(request, collectionScope),
|
|
1105
1160
|
...withPagingBounds({}, limit),
|
|
@@ -1121,6 +1176,16 @@ export function stacSearchSource(descriptor, client, policy) {
|
|
|
1121
1176
|
async *stream(request) {
|
|
1122
1177
|
ensureCapability(descriptor, caps, "stream");
|
|
1123
1178
|
const limit = request?.pagination?.limit;
|
|
1179
|
+
if (staticCatalog) {
|
|
1180
|
+
// A static catalog has no server-side paging; yield the whole
|
|
1181
|
+
// filtered set as one page.
|
|
1182
|
+
const response = await staticCatalog.search(toStacStaticParams(toStacRequest(request, collectionScope)));
|
|
1183
|
+
yield {
|
|
1184
|
+
features: (response.features ?? []).map((toTypedFeatureFromStac)),
|
|
1185
|
+
exceededTransferLimit: false,
|
|
1186
|
+
};
|
|
1187
|
+
return;
|
|
1188
|
+
}
|
|
1124
1189
|
const stream = stac.searchStream({
|
|
1125
1190
|
...toStacRequest(request, collectionScope),
|
|
1126
1191
|
pageSize: limit !== undefined ? Math.max(1, limit) : undefined,
|
|
@@ -1140,10 +1205,12 @@ export function stacSearchSource(descriptor, client, policy) {
|
|
|
1140
1205
|
// routes through `withPagingBounds` so the underlying searchAll
|
|
1141
1206
|
// fetches at most `limit + 1` rows, never a full-catalog scan.
|
|
1142
1207
|
const limit = request?.pagination?.limit;
|
|
1143
|
-
const items =
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1208
|
+
const items = staticCatalog
|
|
1209
|
+
? ((await staticCatalog.search(toStacStaticParams(toStacRequest(request, collectionScope)))).features ?? [])
|
|
1210
|
+
: await stac.searchAll({
|
|
1211
|
+
...toStacRequest(request, collectionScope),
|
|
1212
|
+
...withPagingBounds({}, limit),
|
|
1213
|
+
});
|
|
1147
1214
|
const ids = [];
|
|
1148
1215
|
for (const item of items) {
|
|
1149
1216
|
if (item.id !== undefined && item.id !== null) {
|
|
@@ -2901,6 +2968,20 @@ function requireOgcLocator(descriptor) {
|
|
|
2901
2968
|
}
|
|
2902
2969
|
return { collectionId };
|
|
2903
2970
|
}
|
|
2971
|
+
/**
|
|
2972
|
+
* Map a `SourceLocator.layout` hint onto the OGC API Features endpoint
|
|
2973
|
+
* discovery mode. `undefined` / `honua-facade` keep the fixed facade fast
|
|
2974
|
+
* path; `ogc-api` and `auto` enable spec-driven landing-page discovery.
|
|
2975
|
+
* The STAC-specific modes are not applicable to Features and fall back to
|
|
2976
|
+
* the facade.
|
|
2977
|
+
*/
|
|
2978
|
+
function ogcFeaturesLayoutMode(layout) {
|
|
2979
|
+
if (layout === "ogc-api")
|
|
2980
|
+
return "ogc-api";
|
|
2981
|
+
if (layout === "auto")
|
|
2982
|
+
return "auto";
|
|
2983
|
+
return undefined;
|
|
2984
|
+
}
|
|
2904
2985
|
function requireOgcRecordsLocator(descriptor) {
|
|
2905
2986
|
const { collectionId } = descriptor.locator;
|
|
2906
2987
|
if (collectionId === undefined || collectionId === null || collectionId === "") {
|
|
@@ -2908,6 +2989,13 @@ function requireOgcRecordsLocator(descriptor) {
|
|
|
2908
2989
|
}
|
|
2909
2990
|
return { collectionId };
|
|
2910
2991
|
}
|
|
2992
|
+
function requirePmtilesLocator(descriptor) {
|
|
2993
|
+
const { url } = descriptor.locator;
|
|
2994
|
+
if (typeof url !== "string" || url === "") {
|
|
2995
|
+
throw new Error(`createDataset: source "${descriptor.id}" (pmtiles) requires locator.url`);
|
|
2996
|
+
}
|
|
2997
|
+
return url;
|
|
2998
|
+
}
|
|
2911
2999
|
function requireImageServiceLocator(descriptor) {
|
|
2912
3000
|
const { serviceId } = descriptor.locator;
|
|
2913
3001
|
if (typeof serviceId !== "string") {
|
|
@@ -3110,6 +3198,24 @@ function toStacRequest(request, collectionScope) {
|
|
|
3110
3198
|
out.signal = request.signal;
|
|
3111
3199
|
return out;
|
|
3112
3200
|
}
|
|
3201
|
+
/**
|
|
3202
|
+
* Project a STAC API search request onto the client-side filter params a
|
|
3203
|
+
* static catalog traversal applies (it has no server-side query grammar).
|
|
3204
|
+
*/
|
|
3205
|
+
function toStacStaticParams(request) {
|
|
3206
|
+
const out = {};
|
|
3207
|
+
if (request.collections && request.collections.length > 0)
|
|
3208
|
+
out.collections = request.collections;
|
|
3209
|
+
if (request.bbox)
|
|
3210
|
+
out.bbox = request.bbox;
|
|
3211
|
+
if (request.datetime !== undefined)
|
|
3212
|
+
out.datetime = request.datetime;
|
|
3213
|
+
if (request.limit !== undefined)
|
|
3214
|
+
out.limit = request.limit;
|
|
3215
|
+
if (request.signal)
|
|
3216
|
+
out.signal = request.signal;
|
|
3217
|
+
return out;
|
|
3218
|
+
}
|
|
3113
3219
|
function toTypedFeatureFromStac(feature) {
|
|
3114
3220
|
return {
|
|
3115
3221
|
attributes: (feature.properties ?? {}),
|
|
@@ -3799,4 +3905,5 @@ export const FIRST_PARTY_PROTOCOLS = new Set([
|
|
|
3799
3905
|
"wfs",
|
|
3800
3906
|
"wms",
|
|
3801
3907
|
"wmts",
|
|
3908
|
+
"pmtiles",
|
|
3802
3909
|
]);
|