@walkthru-earth/objex-utils 1.2.1 → 1.3.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/README.md +8 -0
- package/dist/index.cjs +228 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +137 -2
- package/dist/index.d.ts +137 -2
- package/dist/index.js +223 -26
- package/dist/index.js.map +1 -1
- package/docs/README.md +1 -0
- package/docs/parquet-metadata.md +9 -1
- package/docs/stac-geoparquet.md +198 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -596,11 +596,17 @@ interface GeoParquetMeta {
|
|
|
596
596
|
interface ParquetFileMetadata {
|
|
597
597
|
/** Total number of rows across all row groups. */
|
|
598
598
|
rowCount: number;
|
|
599
|
-
/** Column schema (name + type). */
|
|
599
|
+
/** Column schema (name + type). Leaf columns only (structs flattened to children). */
|
|
600
600
|
schema: {
|
|
601
601
|
name: string;
|
|
602
602
|
type: string;
|
|
603
603
|
}[];
|
|
604
|
+
/**
|
|
605
|
+
* Top-level column names as written. Includes struct/group parents (e.g.
|
|
606
|
+
* `assets`, `bbox`) that `schema` flattens away. Required for stac-geoparquet
|
|
607
|
+
* detection, which looks up struct columns by their parent name.
|
|
608
|
+
*/
|
|
609
|
+
topLevelColumns: string[];
|
|
604
610
|
/** GeoParquet "geo" metadata if present. */
|
|
605
611
|
geo: GeoParquetMeta | null;
|
|
606
612
|
/** True when file has legacy GeoParquet metadata (schema_version 0.x without "version" field). */
|
|
@@ -633,6 +639,135 @@ declare function extractGeometryTypes(geo: GeoParquetMeta): GeoArrowGeomType[];
|
|
|
633
639
|
*/
|
|
634
640
|
declare function extractBounds(geo: GeoParquetMeta): [number, number, number, number] | null;
|
|
635
641
|
|
|
642
|
+
/**
|
|
643
|
+
* STAC (SpatioTemporal Asset Catalog) detection and parsing.
|
|
644
|
+
*
|
|
645
|
+
* Pure TypeScript helpers shared by ViewerRouter, StacMosaicViewer, and
|
|
646
|
+
* MultiCogViewer. No Svelte dependency, publishable via objex-utils.
|
|
647
|
+
*/
|
|
648
|
+
/** STAC Link (shared by Catalog/Collection/Item). */
|
|
649
|
+
interface StacLink {
|
|
650
|
+
rel: string;
|
|
651
|
+
href: string;
|
|
652
|
+
type?: string;
|
|
653
|
+
title?: string;
|
|
654
|
+
}
|
|
655
|
+
/** STAC Item (GeoJSON Feature shape with stac_version). */
|
|
656
|
+
interface StacItem {
|
|
657
|
+
type: 'Feature';
|
|
658
|
+
stac_version: string;
|
|
659
|
+
id: string;
|
|
660
|
+
bbox?: [number, number, number, number];
|
|
661
|
+
geometry?: unknown;
|
|
662
|
+
properties?: Record<string, unknown>;
|
|
663
|
+
assets?: Record<string, StacAsset>;
|
|
664
|
+
collection?: string;
|
|
665
|
+
links?: StacLink[];
|
|
666
|
+
}
|
|
667
|
+
/** Single asset entry within a STAC item. */
|
|
668
|
+
interface StacAsset {
|
|
669
|
+
href: string;
|
|
670
|
+
type?: string;
|
|
671
|
+
title?: string;
|
|
672
|
+
roles?: string[];
|
|
673
|
+
/** Set when the asset carries `eo:bands`. */
|
|
674
|
+
'eo:bands'?: {
|
|
675
|
+
name?: string;
|
|
676
|
+
common_name?: string;
|
|
677
|
+
}[];
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* stac-geoparquet helpers.
|
|
682
|
+
*
|
|
683
|
+
* Pure TypeScript, zero Svelte / DuckDB / deck.gl dependencies. Re-exported
|
|
684
|
+
* through `@walkthru-earth/objex-utils` so other projects can consume the
|
|
685
|
+
* detection + row-to-Item transforms without pulling the Svelte lib.
|
|
686
|
+
*
|
|
687
|
+
* The module is decoupled from WKB decoding: callers pass a `wkbParser`
|
|
688
|
+
* callback (the objex Svelte lib threads its `parseWKB`; other consumers
|
|
689
|
+
* can plug in `geoarrow-wasm`, `wkx`, or any other library).
|
|
690
|
+
*/
|
|
691
|
+
|
|
692
|
+
/** Minimal schema column shape. Works with hyparquet, DuckDB, Arrow. */
|
|
693
|
+
interface StacGeoparquetSchemaColumn {
|
|
694
|
+
name: string;
|
|
695
|
+
type?: string;
|
|
696
|
+
}
|
|
697
|
+
/** Bbox in struct shape as produced by DuckDB's `bbox struct(xmin,ymin,xmax,ymax)`. */
|
|
698
|
+
interface StacBboxStruct {
|
|
699
|
+
xmin: number;
|
|
700
|
+
ymin: number;
|
|
701
|
+
xmax: number;
|
|
702
|
+
ymax: number;
|
|
703
|
+
}
|
|
704
|
+
/** Generic Record shape representing a single stac-geoparquet row after DuckDB decoding. */
|
|
705
|
+
type StacGeoparquetRow = Record<string, unknown>;
|
|
706
|
+
interface StacRowToItemOptions {
|
|
707
|
+
/**
|
|
708
|
+
* Decoder for the geometry column. Accepts a Uint8Array of WKB bytes and
|
|
709
|
+
* returns a GeoJSON geometry object (or null on failure).
|
|
710
|
+
*
|
|
711
|
+
* Consumers in the objex Svelte lib should pass `parseWKB` from
|
|
712
|
+
* `@walkthru-earth/objex-utils`. Other projects can use any WKB library.
|
|
713
|
+
*/
|
|
714
|
+
wkbParser?: (bytes: Uint8Array) => unknown;
|
|
715
|
+
/**
|
|
716
|
+
* Column name holding the WKB bytes. Defaults to `'geom_wkb'` because the
|
|
717
|
+
* recommended SQL projection is `ST_AsWKB(geometry) AS geom_wkb`.
|
|
718
|
+
*/
|
|
719
|
+
wkbColumn?: string;
|
|
720
|
+
/** Override the column holding the pre-decoded GeoJSON geometry, when available. */
|
|
721
|
+
geometryColumn?: string;
|
|
722
|
+
}
|
|
723
|
+
/** Columns every stac-geoparquet file MUST carry per the stac-geoparquet spec. */
|
|
724
|
+
declare const STAC_GEOPARQUET_REQUIRED_COLUMNS: readonly ["stac_version", "type", "geometry", "assets"];
|
|
725
|
+
/**
|
|
726
|
+
* Detect stac-geoparquet by presence of the required STAC columns.
|
|
727
|
+
*
|
|
728
|
+
* Deliberately type-agnostic: some pipelines know the type (DuckDB DESCRIBE,
|
|
729
|
+
* Arrow Field), others only have the name list (hyparquet schema walk). The
|
|
730
|
+
* set of names is sufficient for routing.
|
|
731
|
+
*/
|
|
732
|
+
declare function isStacGeoparquetSchema(schema: StacGeoparquetSchemaColumn[]): boolean;
|
|
733
|
+
/**
|
|
734
|
+
* Flatten a DuckDB `struct(xmin,ymin,xmax,ymax)` bbox to the `[minX, minY, maxX, maxY]`
|
|
735
|
+
* array shape that STAC Items and deck.gl-geotiff MosaicLayer expect.
|
|
736
|
+
*
|
|
737
|
+
* Pass-through for arrays so callers that already have `[minX,minY,maxX,maxY]`
|
|
738
|
+
* shape (e.g. from a Feature's `bbox` field) don't need a separate path.
|
|
739
|
+
*/
|
|
740
|
+
declare function flattenStacBbox(bbox: StacBboxStruct | number[] | null | undefined): [number, number, number, number] | null;
|
|
741
|
+
/**
|
|
742
|
+
* Resolve a possibly-relative STAC asset href against the parquet file URL.
|
|
743
|
+
*
|
|
744
|
+
* `./foo.tif` or `foo.tif` → absolute against `baseUrl`. Absolute URLs
|
|
745
|
+
* (`http(s)://`, `s3://`, `gs://`, etc.) are returned unchanged.
|
|
746
|
+
*/
|
|
747
|
+
declare function resolveStacAssetHref(href: string, baseUrl: string): string;
|
|
748
|
+
/**
|
|
749
|
+
* Pick the "primary" asset from a STAC Item's `assets` map.
|
|
750
|
+
*
|
|
751
|
+
* Priority: caller-specified `preferredKeys` → `data` key → first asset with
|
|
752
|
+
* `roles` containing `'data'` → first asset. Returns `null` if the map is
|
|
753
|
+
* empty or not an object.
|
|
754
|
+
*/
|
|
755
|
+
declare function pickStacPrimaryAsset(assets: Record<string, StacAsset> | null | undefined, preferredKeys?: readonly string[]): {
|
|
756
|
+
key: string;
|
|
757
|
+
asset: StacAsset;
|
|
758
|
+
} | null;
|
|
759
|
+
/**
|
|
760
|
+
* Convert one stac-geoparquet row into a standard STAC Item JSON object.
|
|
761
|
+
*
|
|
762
|
+
* Handles:
|
|
763
|
+
* - `assets` named-struct flattening + relative href resolution
|
|
764
|
+
* - `bbox` struct → `[minX, minY, maxX, maxY]` array
|
|
765
|
+
* - Optional WKB geometry → GeoJSON via `opts.wkbParser`
|
|
766
|
+
* - `datetime` → ISO string (passes through already-string values)
|
|
767
|
+
* - Promotes `properties.*` columns (`proj:*`, `datetime`) onto `item.properties`
|
|
768
|
+
*/
|
|
769
|
+
declare function stacRowToItem(row: StacGeoparquetRow, baseUrl: string, opts?: StacRowToItemOptions): StacItem;
|
|
770
|
+
|
|
636
771
|
/**
|
|
637
772
|
* Universal cloud storage URL / bucket parser.
|
|
638
773
|
*
|
|
@@ -742,4 +877,4 @@ declare function findGeoColumnFromRows(rows: Record<string, unknown>[], schema:
|
|
|
742
877
|
type: string;
|
|
743
878
|
}[]): string | null;
|
|
744
879
|
|
|
745
|
-
export { type AccessMode, type AccessModeInput, COPY_FEEDBACK_MS, type CogInfo, type Connection, type ConnectionConfig, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, type Defaults, type DuckDbReadFn, type FileCategory, type FileEntry, type FileTypeInfo, type GeoArrowGeomType, type GeoArrowResult, type GeoBounds, type GeoColumnMeta, type GeoParquetMeta, type GeoType, type HexRow, LAYER_HUE_MULTIPLIER, type ListPage, MAX_QUERY_HISTORY_ENTRIES, type MapQueryHandle, type MapQueryResult, PROVIDERS, PROVIDER_IDS, type ParquetFileMetadata, type ParsedGeometry, type ParsedMarkdownDocument, type ParsedStorageUrl, type ProviderDef, type ProviderId, type ProviderRegion, QueryCancelledError, type QueryEngine, type QueryHandle, type QueryResult, type QuerySource, SF_LABELS, SQL_PREVIEW_LENGTH, STORAGE_KEYS, type SchemaField, type SortConfig, type SortDirection, type SortField, type SqlBlock, type StorageAdapter, type StorageProvider, type Tab, type Theme, type TypeCategory, UrlAdapter, VIEWER_DIR_EXTENSIONS, type ViewerKind, WGS84_CODES, type WriteResult, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, exportToCsv, exportToJson, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, formatValue, generateHexDump, getAccessMode, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isPubliclyStreamable, isQueryable, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, readParquetMetadata, resolveCloudUrl, resolveProviderEndpoint, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|
|
880
|
+
export { type AccessMode, type AccessModeInput, COPY_FEEDBACK_MS, type CogInfo, type Connection, type ConnectionConfig, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, type Defaults, type DuckDbReadFn, type FileCategory, type FileEntry, type FileTypeInfo, type GeoArrowGeomType, type GeoArrowResult, type GeoBounds, type GeoColumnMeta, type GeoParquetMeta, type GeoType, type HexRow, LAYER_HUE_MULTIPLIER, type ListPage, MAX_QUERY_HISTORY_ENTRIES, type MapQueryHandle, type MapQueryResult, PROVIDERS, PROVIDER_IDS, type ParquetFileMetadata, type ParsedGeometry, type ParsedMarkdownDocument, type ParsedStorageUrl, type ProviderDef, type ProviderId, type ProviderRegion, QueryCancelledError, type QueryEngine, type QueryHandle, type QueryResult, type QuerySource, SF_LABELS, SQL_PREVIEW_LENGTH, STAC_GEOPARQUET_REQUIRED_COLUMNS, STORAGE_KEYS, type SchemaField, type SortConfig, type SortDirection, type SortField, type SqlBlock, type StacBboxStruct, type StacGeoparquetRow, type StacGeoparquetSchemaColumn, type StacRowToItemOptions, type StorageAdapter, type StorageProvider, type Tab, type Theme, type TypeCategory, UrlAdapter, VIEWER_DIR_EXTENSIONS, type ViewerKind, WGS84_CODES, type WriteResult, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, exportToCsv, exportToJson, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, flattenStacBbox, formatDate, formatFileSize, formatValue, generateHexDump, getAccessMode, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isPubliclyStreamable, isQueryable, isStacGeoparquetSchema, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, pickStacPrimaryAsset, readParquetMetadata, resolveCloudUrl, resolveProviderEndpoint, resolveStacAssetHref, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, stacRowToItem, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|
package/dist/index.d.ts
CHANGED
|
@@ -596,11 +596,17 @@ interface GeoParquetMeta {
|
|
|
596
596
|
interface ParquetFileMetadata {
|
|
597
597
|
/** Total number of rows across all row groups. */
|
|
598
598
|
rowCount: number;
|
|
599
|
-
/** Column schema (name + type). */
|
|
599
|
+
/** Column schema (name + type). Leaf columns only (structs flattened to children). */
|
|
600
600
|
schema: {
|
|
601
601
|
name: string;
|
|
602
602
|
type: string;
|
|
603
603
|
}[];
|
|
604
|
+
/**
|
|
605
|
+
* Top-level column names as written. Includes struct/group parents (e.g.
|
|
606
|
+
* `assets`, `bbox`) that `schema` flattens away. Required for stac-geoparquet
|
|
607
|
+
* detection, which looks up struct columns by their parent name.
|
|
608
|
+
*/
|
|
609
|
+
topLevelColumns: string[];
|
|
604
610
|
/** GeoParquet "geo" metadata if present. */
|
|
605
611
|
geo: GeoParquetMeta | null;
|
|
606
612
|
/** True when file has legacy GeoParquet metadata (schema_version 0.x without "version" field). */
|
|
@@ -633,6 +639,135 @@ declare function extractGeometryTypes(geo: GeoParquetMeta): GeoArrowGeomType[];
|
|
|
633
639
|
*/
|
|
634
640
|
declare function extractBounds(geo: GeoParquetMeta): [number, number, number, number] | null;
|
|
635
641
|
|
|
642
|
+
/**
|
|
643
|
+
* STAC (SpatioTemporal Asset Catalog) detection and parsing.
|
|
644
|
+
*
|
|
645
|
+
* Pure TypeScript helpers shared by ViewerRouter, StacMosaicViewer, and
|
|
646
|
+
* MultiCogViewer. No Svelte dependency, publishable via objex-utils.
|
|
647
|
+
*/
|
|
648
|
+
/** STAC Link (shared by Catalog/Collection/Item). */
|
|
649
|
+
interface StacLink {
|
|
650
|
+
rel: string;
|
|
651
|
+
href: string;
|
|
652
|
+
type?: string;
|
|
653
|
+
title?: string;
|
|
654
|
+
}
|
|
655
|
+
/** STAC Item (GeoJSON Feature shape with stac_version). */
|
|
656
|
+
interface StacItem {
|
|
657
|
+
type: 'Feature';
|
|
658
|
+
stac_version: string;
|
|
659
|
+
id: string;
|
|
660
|
+
bbox?: [number, number, number, number];
|
|
661
|
+
geometry?: unknown;
|
|
662
|
+
properties?: Record<string, unknown>;
|
|
663
|
+
assets?: Record<string, StacAsset>;
|
|
664
|
+
collection?: string;
|
|
665
|
+
links?: StacLink[];
|
|
666
|
+
}
|
|
667
|
+
/** Single asset entry within a STAC item. */
|
|
668
|
+
interface StacAsset {
|
|
669
|
+
href: string;
|
|
670
|
+
type?: string;
|
|
671
|
+
title?: string;
|
|
672
|
+
roles?: string[];
|
|
673
|
+
/** Set when the asset carries `eo:bands`. */
|
|
674
|
+
'eo:bands'?: {
|
|
675
|
+
name?: string;
|
|
676
|
+
common_name?: string;
|
|
677
|
+
}[];
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* stac-geoparquet helpers.
|
|
682
|
+
*
|
|
683
|
+
* Pure TypeScript, zero Svelte / DuckDB / deck.gl dependencies. Re-exported
|
|
684
|
+
* through `@walkthru-earth/objex-utils` so other projects can consume the
|
|
685
|
+
* detection + row-to-Item transforms without pulling the Svelte lib.
|
|
686
|
+
*
|
|
687
|
+
* The module is decoupled from WKB decoding: callers pass a `wkbParser`
|
|
688
|
+
* callback (the objex Svelte lib threads its `parseWKB`; other consumers
|
|
689
|
+
* can plug in `geoarrow-wasm`, `wkx`, or any other library).
|
|
690
|
+
*/
|
|
691
|
+
|
|
692
|
+
/** Minimal schema column shape. Works with hyparquet, DuckDB, Arrow. */
|
|
693
|
+
interface StacGeoparquetSchemaColumn {
|
|
694
|
+
name: string;
|
|
695
|
+
type?: string;
|
|
696
|
+
}
|
|
697
|
+
/** Bbox in struct shape as produced by DuckDB's `bbox struct(xmin,ymin,xmax,ymax)`. */
|
|
698
|
+
interface StacBboxStruct {
|
|
699
|
+
xmin: number;
|
|
700
|
+
ymin: number;
|
|
701
|
+
xmax: number;
|
|
702
|
+
ymax: number;
|
|
703
|
+
}
|
|
704
|
+
/** Generic Record shape representing a single stac-geoparquet row after DuckDB decoding. */
|
|
705
|
+
type StacGeoparquetRow = Record<string, unknown>;
|
|
706
|
+
interface StacRowToItemOptions {
|
|
707
|
+
/**
|
|
708
|
+
* Decoder for the geometry column. Accepts a Uint8Array of WKB bytes and
|
|
709
|
+
* returns a GeoJSON geometry object (or null on failure).
|
|
710
|
+
*
|
|
711
|
+
* Consumers in the objex Svelte lib should pass `parseWKB` from
|
|
712
|
+
* `@walkthru-earth/objex-utils`. Other projects can use any WKB library.
|
|
713
|
+
*/
|
|
714
|
+
wkbParser?: (bytes: Uint8Array) => unknown;
|
|
715
|
+
/**
|
|
716
|
+
* Column name holding the WKB bytes. Defaults to `'geom_wkb'` because the
|
|
717
|
+
* recommended SQL projection is `ST_AsWKB(geometry) AS geom_wkb`.
|
|
718
|
+
*/
|
|
719
|
+
wkbColumn?: string;
|
|
720
|
+
/** Override the column holding the pre-decoded GeoJSON geometry, when available. */
|
|
721
|
+
geometryColumn?: string;
|
|
722
|
+
}
|
|
723
|
+
/** Columns every stac-geoparquet file MUST carry per the stac-geoparquet spec. */
|
|
724
|
+
declare const STAC_GEOPARQUET_REQUIRED_COLUMNS: readonly ["stac_version", "type", "geometry", "assets"];
|
|
725
|
+
/**
|
|
726
|
+
* Detect stac-geoparquet by presence of the required STAC columns.
|
|
727
|
+
*
|
|
728
|
+
* Deliberately type-agnostic: some pipelines know the type (DuckDB DESCRIBE,
|
|
729
|
+
* Arrow Field), others only have the name list (hyparquet schema walk). The
|
|
730
|
+
* set of names is sufficient for routing.
|
|
731
|
+
*/
|
|
732
|
+
declare function isStacGeoparquetSchema(schema: StacGeoparquetSchemaColumn[]): boolean;
|
|
733
|
+
/**
|
|
734
|
+
* Flatten a DuckDB `struct(xmin,ymin,xmax,ymax)` bbox to the `[minX, minY, maxX, maxY]`
|
|
735
|
+
* array shape that STAC Items and deck.gl-geotiff MosaicLayer expect.
|
|
736
|
+
*
|
|
737
|
+
* Pass-through for arrays so callers that already have `[minX,minY,maxX,maxY]`
|
|
738
|
+
* shape (e.g. from a Feature's `bbox` field) don't need a separate path.
|
|
739
|
+
*/
|
|
740
|
+
declare function flattenStacBbox(bbox: StacBboxStruct | number[] | null | undefined): [number, number, number, number] | null;
|
|
741
|
+
/**
|
|
742
|
+
* Resolve a possibly-relative STAC asset href against the parquet file URL.
|
|
743
|
+
*
|
|
744
|
+
* `./foo.tif` or `foo.tif` → absolute against `baseUrl`. Absolute URLs
|
|
745
|
+
* (`http(s)://`, `s3://`, `gs://`, etc.) are returned unchanged.
|
|
746
|
+
*/
|
|
747
|
+
declare function resolveStacAssetHref(href: string, baseUrl: string): string;
|
|
748
|
+
/**
|
|
749
|
+
* Pick the "primary" asset from a STAC Item's `assets` map.
|
|
750
|
+
*
|
|
751
|
+
* Priority: caller-specified `preferredKeys` → `data` key → first asset with
|
|
752
|
+
* `roles` containing `'data'` → first asset. Returns `null` if the map is
|
|
753
|
+
* empty or not an object.
|
|
754
|
+
*/
|
|
755
|
+
declare function pickStacPrimaryAsset(assets: Record<string, StacAsset> | null | undefined, preferredKeys?: readonly string[]): {
|
|
756
|
+
key: string;
|
|
757
|
+
asset: StacAsset;
|
|
758
|
+
} | null;
|
|
759
|
+
/**
|
|
760
|
+
* Convert one stac-geoparquet row into a standard STAC Item JSON object.
|
|
761
|
+
*
|
|
762
|
+
* Handles:
|
|
763
|
+
* - `assets` named-struct flattening + relative href resolution
|
|
764
|
+
* - `bbox` struct → `[minX, minY, maxX, maxY]` array
|
|
765
|
+
* - Optional WKB geometry → GeoJSON via `opts.wkbParser`
|
|
766
|
+
* - `datetime` → ISO string (passes through already-string values)
|
|
767
|
+
* - Promotes `properties.*` columns (`proj:*`, `datetime`) onto `item.properties`
|
|
768
|
+
*/
|
|
769
|
+
declare function stacRowToItem(row: StacGeoparquetRow, baseUrl: string, opts?: StacRowToItemOptions): StacItem;
|
|
770
|
+
|
|
636
771
|
/**
|
|
637
772
|
* Universal cloud storage URL / bucket parser.
|
|
638
773
|
*
|
|
@@ -742,4 +877,4 @@ declare function findGeoColumnFromRows(rows: Record<string, unknown>[], schema:
|
|
|
742
877
|
type: string;
|
|
743
878
|
}[]): string | null;
|
|
744
879
|
|
|
745
|
-
export { type AccessMode, type AccessModeInput, COPY_FEEDBACK_MS, type CogInfo, type Connection, type ConnectionConfig, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, type Defaults, type DuckDbReadFn, type FileCategory, type FileEntry, type FileTypeInfo, type GeoArrowGeomType, type GeoArrowResult, type GeoBounds, type GeoColumnMeta, type GeoParquetMeta, type GeoType, type HexRow, LAYER_HUE_MULTIPLIER, type ListPage, MAX_QUERY_HISTORY_ENTRIES, type MapQueryHandle, type MapQueryResult, PROVIDERS, PROVIDER_IDS, type ParquetFileMetadata, type ParsedGeometry, type ParsedMarkdownDocument, type ParsedStorageUrl, type ProviderDef, type ProviderId, type ProviderRegion, QueryCancelledError, type QueryEngine, type QueryHandle, type QueryResult, type QuerySource, SF_LABELS, SQL_PREVIEW_LENGTH, STORAGE_KEYS, type SchemaField, type SortConfig, type SortDirection, type SortField, type SqlBlock, type StorageAdapter, type StorageProvider, type Tab, type Theme, type TypeCategory, UrlAdapter, VIEWER_DIR_EXTENSIONS, type ViewerKind, WGS84_CODES, type WriteResult, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, exportToCsv, exportToJson, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, formatValue, generateHexDump, getAccessMode, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isPubliclyStreamable, isQueryable, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, readParquetMetadata, resolveCloudUrl, resolveProviderEndpoint, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|
|
880
|
+
export { type AccessMode, type AccessModeInput, COPY_FEEDBACK_MS, type CogInfo, type Connection, type ConnectionConfig, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, type Defaults, type DuckDbReadFn, type FileCategory, type FileEntry, type FileTypeInfo, type GeoArrowGeomType, type GeoArrowResult, type GeoBounds, type GeoColumnMeta, type GeoParquetMeta, type GeoType, type HexRow, LAYER_HUE_MULTIPLIER, type ListPage, MAX_QUERY_HISTORY_ENTRIES, type MapQueryHandle, type MapQueryResult, PROVIDERS, PROVIDER_IDS, type ParquetFileMetadata, type ParsedGeometry, type ParsedMarkdownDocument, type ParsedStorageUrl, type ProviderDef, type ProviderId, type ProviderRegion, QueryCancelledError, type QueryEngine, type QueryHandle, type QueryResult, type QuerySource, SF_LABELS, SQL_PREVIEW_LENGTH, STAC_GEOPARQUET_REQUIRED_COLUMNS, STORAGE_KEYS, type SchemaField, type SortConfig, type SortDirection, type SortField, type SqlBlock, type StacBboxStruct, type StacGeoparquetRow, type StacGeoparquetSchemaColumn, type StacRowToItemOptions, type StorageAdapter, type StorageProvider, type Tab, type Theme, type TypeCategory, UrlAdapter, VIEWER_DIR_EXTENSIONS, type ViewerKind, WGS84_CODES, type WriteResult, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, exportToCsv, exportToJson, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, flattenStacBbox, formatDate, formatFileSize, formatValue, generateHexDump, getAccessMode, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isPubliclyStreamable, isQueryable, isStacGeoparquetSchema, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, pickStacPrimaryAsset, readParquetMetadata, resolveCloudUrl, resolveProviderEndpoint, resolveStacAssetHref, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, stacRowToItem, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|