geo-polygonize 0.34.0 → 0.35.1

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.
Files changed (71) hide show
  1. package/README.md +68 -18
  2. package/dist/geo_polygonize.wasm +0 -0
  3. package/dist/geo_polygonize_simd.wasm +0 -0
  4. package/dist/slim/cjs/index_slim.d.ts +1 -1
  5. package/dist/slim/cjs/index_slim.js +19 -850
  6. package/dist/slim/es/index_slim.d.ts +1 -1
  7. package/dist/slim/es/index_slim.js +11 -842
  8. package/dist/slim/pkg-scalar/geo_polygonize.d.ts +119 -0
  9. package/dist/slim/pkg-scalar/geo_polygonize_bg.wasm.d.ts +37 -0
  10. package/dist/slim/pkg-wrapper/bindings/ContainmentOptions.d.ts +6 -0
  11. package/dist/slim/pkg-wrapper/bindings/DedupPolicy.d.ts +1 -0
  12. package/dist/slim/pkg-wrapper/bindings/DeterminismOptions.d.ts +5 -0
  13. package/dist/slim/pkg-wrapper/bindings/DiagnosticsOptions.d.ts +4 -0
  14. package/dist/slim/pkg-wrapper/bindings/IndexBackend.d.ts +1 -0
  15. package/dist/slim/pkg-wrapper/bindings/NodingBackend.d.ts +1 -0
  16. package/dist/slim/pkg-wrapper/bindings/NodingOptions.d.ts +6 -0
  17. package/dist/slim/pkg-wrapper/bindings/PolygonizerOptions.d.ts +92 -0
  18. package/dist/slim/pkg-wrapper/bindings/ProvenanceOptions.d.ts +4 -0
  19. package/dist/slim/pkg-wrapper/bindings/SnapMode.d.ts +1 -0
  20. package/dist/slim/pkg-wrapper/bindings/SnapStrategy.d.ts +25 -0
  21. package/dist/slim/pkg-wrapper/bindings/TargetProfile.d.ts +1 -0
  22. package/dist/slim/pkg-wrapper/bindings/TileOwnershipPolicy.d.ts +1 -0
  23. package/dist/slim/pkg-wrapper/bindings/TilingOptions.d.ts +6 -0
  24. package/dist/slim/pkg-wrapper/bindings/TouchPolicy.d.ts +1 -0
  25. package/dist/slim/pkg-wrapper/bindings/ZOptions.d.ts +4 -0
  26. package/dist/slim/pkg-wrapper/bindings/ZPolicy.d.ts +5 -0
  27. package/dist/standard/cjs/index.js +3 -3
  28. package/dist/standard/cjs/index_slim.d.ts +1 -1
  29. package/dist/standard/es/index.js +3 -3
  30. package/dist/standard/es/index_slim.d.ts +1 -1
  31. package/dist/standard/pkg-scalar/geo_polygonize.d.ts +119 -0
  32. package/dist/standard/pkg-scalar/geo_polygonize_bg.wasm.d.ts +37 -0
  33. package/dist/standard/pkg-wrapper/bindings/ContainmentOptions.d.ts +6 -0
  34. package/dist/standard/pkg-wrapper/bindings/DedupPolicy.d.ts +1 -0
  35. package/dist/standard/pkg-wrapper/bindings/DeterminismOptions.d.ts +5 -0
  36. package/dist/standard/pkg-wrapper/bindings/DiagnosticsOptions.d.ts +4 -0
  37. package/dist/standard/pkg-wrapper/bindings/IndexBackend.d.ts +1 -0
  38. package/dist/standard/pkg-wrapper/bindings/NodingBackend.d.ts +1 -0
  39. package/dist/standard/pkg-wrapper/bindings/NodingOptions.d.ts +6 -0
  40. package/dist/standard/pkg-wrapper/bindings/PolygonizerOptions.d.ts +92 -0
  41. package/dist/standard/pkg-wrapper/bindings/ProvenanceOptions.d.ts +4 -0
  42. package/dist/standard/pkg-wrapper/bindings/SnapMode.d.ts +1 -0
  43. package/dist/standard/pkg-wrapper/bindings/SnapStrategy.d.ts +25 -0
  44. package/dist/standard/pkg-wrapper/bindings/TargetProfile.d.ts +1 -0
  45. package/dist/standard/pkg-wrapper/bindings/TileOwnershipPolicy.d.ts +1 -0
  46. package/dist/standard/pkg-wrapper/bindings/TilingOptions.d.ts +6 -0
  47. package/dist/standard/pkg-wrapper/bindings/TouchPolicy.d.ts +1 -0
  48. package/dist/standard/pkg-wrapper/bindings/ZOptions.d.ts +4 -0
  49. package/dist/standard/pkg-wrapper/bindings/ZPolicy.d.ts +5 -0
  50. package/dist/threads/es/index.js +1 -1
  51. package/dist/threads/es/index_slim.d.ts +1 -1
  52. package/dist/threads/pkg-threads/geo_polygonize.d.ts +139 -0
  53. package/dist/threads/pkg-threads/geo_polygonize_bg.wasm.d.ts +44 -0
  54. package/dist/threads/pkg-wrapper/bindings/ContainmentOptions.d.ts +6 -0
  55. package/dist/threads/pkg-wrapper/bindings/DedupPolicy.d.ts +1 -0
  56. package/dist/threads/pkg-wrapper/bindings/DeterminismOptions.d.ts +5 -0
  57. package/dist/threads/pkg-wrapper/bindings/DiagnosticsOptions.d.ts +4 -0
  58. package/dist/threads/pkg-wrapper/bindings/IndexBackend.d.ts +1 -0
  59. package/dist/threads/pkg-wrapper/bindings/NodingBackend.d.ts +1 -0
  60. package/dist/threads/pkg-wrapper/bindings/NodingOptions.d.ts +6 -0
  61. package/dist/threads/pkg-wrapper/bindings/PolygonizerOptions.d.ts +92 -0
  62. package/dist/threads/pkg-wrapper/bindings/ProvenanceOptions.d.ts +4 -0
  63. package/dist/threads/pkg-wrapper/bindings/SnapMode.d.ts +1 -0
  64. package/dist/threads/pkg-wrapper/bindings/SnapStrategy.d.ts +25 -0
  65. package/dist/threads/pkg-wrapper/bindings/TargetProfile.d.ts +1 -0
  66. package/dist/threads/pkg-wrapper/bindings/TileOwnershipPolicy.d.ts +1 -0
  67. package/dist/threads/pkg-wrapper/bindings/TilingOptions.d.ts +6 -0
  68. package/dist/threads/pkg-wrapper/bindings/TouchPolicy.d.ts +1 -0
  69. package/dist/threads/pkg-wrapper/bindings/ZOptions.d.ts +4 -0
  70. package/dist/threads/pkg-wrapper/bindings/ZPolicy.d.ts +5 -0
  71. package/package.json +1 -1
@@ -17,4 +17,4 @@ export * from "./bindings/TouchPolicy";
17
17
  export * from "./bindings/ZOptions";
18
18
  export * from "./bindings/ZPolicy";
19
19
  export * from "./cfb";
20
- export declare function initBest(scalarModule: any, simdModule: any): Promise<typeof scalarExports>;
20
+ export declare function initBest(scalarModule: any, simdModule?: any): Promise<typeof scalarExports>;
@@ -0,0 +1,119 @@
1
+ import { PolygonizerOptions } from '../pkg-wrapper/bindings/PolygonizerOptions';
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ export class PolygonizerWasmError {
6
+ free(): void;
7
+ [Symbol.dispose](): void;
8
+ constructor(name: string, message: string);
9
+ readonly message: string;
10
+ readonly name: string;
11
+ }
12
+
13
+ export class WasmPolygonResult {
14
+ private constructor();
15
+ free(): void;
16
+ [Symbol.dispose](): void;
17
+ coords_len(): number;
18
+ coords_ptr(): number;
19
+ flat_line_ids_len(): number;
20
+ flat_line_ids_ptr(): number;
21
+ polygon_offsets_len(): number;
22
+ polygon_offsets_ptr(): number;
23
+ ring_offsets_len(): number;
24
+ ring_offsets_ptr(): number;
25
+ stride(): number;
26
+ readonly cut_edges: any;
27
+ readonly dangles: any;
28
+ readonly diagnostics: any;
29
+ readonly invalid_rings: any;
30
+ readonly provenance: any;
31
+ }
32
+
33
+ export function polygonize(geojson_str: string, node_input?: boolean | null, snap_grid_size?: number | null, extract_only_polygonal?: boolean | null, report_mode?: boolean | null): string;
34
+
35
+ /**
36
+ * Polygonizes an Arrow IPC stream containing a GeoArrow LineString array.
37
+ *
38
+ * This zero-copy path avoids JSON serialization overhead and returns a binary
39
+ * Arrow IPC stream containing a GeoArrow Polygon array. Requires the options
40
+ * to be passed as a parsed JS object.
41
+ */
42
+ export function polygonizeGeoArrowWithOptions(ipc_bytes: Uint8Array, options_val: Partial<PolygonizerOptions>): Uint8Array;
43
+
44
+ /**
45
+ * Polygonizes a GeoJSON FeatureCollection using the canonical `PolygonizerOptions`.
46
+ *
47
+ * This is the primary entry point for JavaScript users. It accepts a JSON string
48
+ * of options and returns a JSON string representing the result, including faces,
49
+ * dangles, cut-lines, and (optionally) provenance/diagnostics.
50
+ */
51
+ export function polygonizeWithOptions(geojson_str: string, options_val: Partial<PolygonizerOptions>): string;
52
+
53
+ export function polygonizeWithOptionsBuffer(coords: Float64Array, offsets: Uint32Array, stride: number, options_val: Partial<PolygonizerOptions>, line_ids?: Uint32Array | null): WasmPolygonResult;
54
+
55
+ export function polygonize_buffers(coords: Float64Array, offsets: Uint32Array, stride: number, node_input: boolean, snap_grid_size: number, line_ids?: Uint32Array | null): WasmPolygonResult;
56
+
57
+ export function polygonize_geoarrow(ipc_bytes: Uint8Array, node_input: boolean, snap_grid_size: number, extract_only_polygonal: boolean): Uint8Array;
58
+
59
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
60
+
61
+ export interface InitOutput {
62
+ readonly memory: WebAssembly.Memory;
63
+ readonly __wbg_polygonizerwasmerror_free: (a: number, b: number) => void;
64
+ readonly __wbg_wasmpolygonresult_free: (a: number, b: number) => void;
65
+ readonly polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
66
+ readonly polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
67
+ readonly polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
68
+ readonly polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
69
+ readonly polygonize_buffers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
70
+ readonly polygonize_geoarrow: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
71
+ readonly polygonizerwasmerror_message: (a: number) => [number, number];
72
+ readonly polygonizerwasmerror_name: (a: number) => [number, number];
73
+ readonly polygonizerwasmerror_new: (a: number, b: number, c: number, d: number) => number;
74
+ readonly wasmpolygonresult_coords_len: (a: number) => number;
75
+ readonly wasmpolygonresult_coords_ptr: (a: number) => number;
76
+ readonly wasmpolygonresult_cut_edges: (a: number) => any;
77
+ readonly wasmpolygonresult_dangles: (a: number) => any;
78
+ readonly wasmpolygonresult_diagnostics: (a: number) => any;
79
+ readonly wasmpolygonresult_flat_line_ids_len: (a: number) => number;
80
+ readonly wasmpolygonresult_flat_line_ids_ptr: (a: number) => number;
81
+ readonly wasmpolygonresult_invalid_rings: (a: number) => any;
82
+ readonly wasmpolygonresult_polygon_offsets_len: (a: number) => number;
83
+ readonly wasmpolygonresult_polygon_offsets_ptr: (a: number) => number;
84
+ readonly wasmpolygonresult_provenance: (a: number) => any;
85
+ readonly wasmpolygonresult_ring_offsets_len: (a: number) => number;
86
+ readonly wasmpolygonresult_ring_offsets_ptr: (a: number) => number;
87
+ readonly wasmpolygonresult_stride: (a: number) => number;
88
+ readonly polygonize_ffi: (a: number, b: number, c: number, d: number, e: number) => number;
89
+ readonly polygonize_with_options_ffi: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
90
+ readonly polygonize_result_free: () => void;
91
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
92
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
93
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
94
+ readonly __wbindgen_externrefs: WebAssembly.Table;
95
+ readonly __externref_table_dealloc: (a: number) => void;
96
+ readonly __wbindgen_start: () => void;
97
+ }
98
+
99
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
100
+
101
+ /**
102
+ * Instantiates the given `module`, which can either be bytes or
103
+ * a precompiled `WebAssembly.Module`.
104
+ *
105
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
106
+ *
107
+ * @returns {InitOutput}
108
+ */
109
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
110
+
111
+ /**
112
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
113
+ * for everything else, calls `WebAssembly.instantiate` directly.
114
+ *
115
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
116
+ *
117
+ * @returns {Promise<InitOutput>}
118
+ */
119
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,37 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const __wbg_polygonizerwasmerror_free: (a: number, b: number) => void;
5
+ export const __wbg_wasmpolygonresult_free: (a: number, b: number) => void;
6
+ export const polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
7
+ export const polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
8
+ export const polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
9
+ export const polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
10
+ export const polygonize_buffers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
11
+ export const polygonize_geoarrow: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
12
+ export const polygonizerwasmerror_message: (a: number) => [number, number];
13
+ export const polygonizerwasmerror_name: (a: number) => [number, number];
14
+ export const polygonizerwasmerror_new: (a: number, b: number, c: number, d: number) => number;
15
+ export const wasmpolygonresult_coords_len: (a: number) => number;
16
+ export const wasmpolygonresult_coords_ptr: (a: number) => number;
17
+ export const wasmpolygonresult_cut_edges: (a: number) => any;
18
+ export const wasmpolygonresult_dangles: (a: number) => any;
19
+ export const wasmpolygonresult_diagnostics: (a: number) => any;
20
+ export const wasmpolygonresult_flat_line_ids_len: (a: number) => number;
21
+ export const wasmpolygonresult_flat_line_ids_ptr: (a: number) => number;
22
+ export const wasmpolygonresult_invalid_rings: (a: number) => any;
23
+ export const wasmpolygonresult_polygon_offsets_len: (a: number) => number;
24
+ export const wasmpolygonresult_polygon_offsets_ptr: (a: number) => number;
25
+ export const wasmpolygonresult_provenance: (a: number) => any;
26
+ export const wasmpolygonresult_ring_offsets_len: (a: number) => number;
27
+ export const wasmpolygonresult_ring_offsets_ptr: (a: number) => number;
28
+ export const wasmpolygonresult_stride: (a: number) => number;
29
+ export const polygonize_ffi: (a: number, b: number, c: number, d: number, e: number) => number;
30
+ export const polygonize_with_options_ffi: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
31
+ export const polygonize_result_free: () => void;
32
+ export const __wbindgen_malloc: (a: number, b: number) => number;
33
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
34
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
35
+ export const __wbindgen_externrefs: WebAssembly.Table;
36
+ export const __externref_table_dealloc: (a: number) => void;
37
+ export const __wbindgen_start: () => void;
@@ -0,0 +1,6 @@
1
+ import type { IndexBackend } from "./IndexBackend";
2
+ import type { TouchPolicy } from "./TouchPolicy";
3
+ export type ContainmentOptions = {
4
+ touch_policy: TouchPolicy;
5
+ index_backend: IndexBackend;
6
+ };
@@ -0,0 +1 @@
1
+ export type DedupPolicy = "KeepAll" | "CanonicalRingHash";
@@ -0,0 +1,5 @@
1
+ export type DeterminismOptions = {
2
+ canonical_sort: boolean;
3
+ canonical_ring_rotation: boolean;
4
+ stable_tie_breaks: boolean;
5
+ };
@@ -0,0 +1,4 @@
1
+ export type DiagnosticsOptions = {
2
+ enabled: boolean;
3
+ report_mode: boolean;
4
+ };
@@ -0,0 +1 @@
1
+ export type IndexBackend = "RStar" | "PackedNative";
@@ -0,0 +1 @@
1
+ export type NodingBackend = "Snap" | "Advanced";
@@ -0,0 +1,6 @@
1
+ import type { NodingBackend } from "./NodingBackend";
2
+ import type { SnapMode } from "./SnapMode";
3
+ export type NodingOptions = {
4
+ backend: NodingBackend;
5
+ snap_mode: SnapMode;
6
+ };
@@ -0,0 +1,92 @@
1
+ import type { ContainmentOptions } from "./ContainmentOptions";
2
+ import type { DeterminismOptions } from "./DeterminismOptions";
3
+ import type { DiagnosticsOptions } from "./DiagnosticsOptions";
4
+ import type { NodingOptions } from "./NodingOptions";
5
+ import type { ProvenanceOptions } from "./ProvenanceOptions";
6
+ import type { SnapStrategy } from "./SnapStrategy";
7
+ import type { TargetProfile } from "./TargetProfile";
8
+ import type { TilingOptions } from "./TilingOptions";
9
+ import type { ZOptions } from "./ZOptions";
10
+ /**
11
+ * The canonical configuration object for the `geo-polygonize` engine.
12
+ *
13
+ * This struct controls every aspect of the polygonization pipeline, including
14
+ * topological robustness, feature output, containment policies, noding, and determinism.
15
+ */
16
+ export type PolygonizerOptions = {
17
+ /**
18
+ * Determines the execution environment profile (e.g., Native, WasmSingleThread, WasmThreads).
19
+ *
20
+ * Default: `TargetProfile::Native`
21
+ */
22
+ target: TargetProfile;
23
+ /**
24
+ * Whether to robustly node the input before polygonization.
25
+ *
26
+ * Enable this for real-world linework where segment intersections may not
27
+ * already exist as explicit vertices. This is slower than the fast path but
28
+ * avoids missing faces and unresolved crossings.
29
+ *
30
+ * Default: `false`
31
+ */
32
+ node_input: boolean;
33
+ /**
34
+ * The snapping grid size used for vertex deduplication and noding operations.
35
+ *
36
+ * Vertices falling within the same grid cell are coalesced. A size of `0.0`
37
+ * indicates exact floating-point evaluation without grid snapping.
38
+ *
39
+ * Default: `1e-10`
40
+ */
41
+ snap_grid_size: number;
42
+ /**
43
+ * If `true`, only pure, outermost polygonal shells are returned.
44
+ *
45
+ * Floating dangles, internal cut-lines, or invalid rings will be discarded.
46
+ *
47
+ * Default: `false`
48
+ */
49
+ extract_only_polygonal: boolean;
50
+ /**
51
+ * The underlying strategy to apply when snapping coordinate geometries.
52
+ *
53
+ * See `SnapStrategy` for differences between strict `Grid` snapping and
54
+ * Shapely/GEOS `GeosCompat` strategies.
55
+ *
56
+ * Default: `SnapStrategy::Grid`
57
+ */
58
+ snap_strategy: SnapStrategy;
59
+ /**
60
+ * Configures the noding engine backend and behavior.
61
+ */
62
+ noding: NodingOptions;
63
+ /**
64
+ * Configures how topological relationships (containment) are calculated
65
+ * during face formation.
66
+ */
67
+ containment: ContainmentOptions;
68
+ /**
69
+ * Optional configuration for tiled, distributed execution across huge datasets.
70
+ */
71
+ tiling?: TilingOptions;
72
+ /**
73
+ * Configures Z-axis coordinate handling.
74
+ */
75
+ z: ZOptions;
76
+ /**
77
+ * Configuration for enforcing exact topological determinism.
78
+ */
79
+ determinism: DeterminismOptions;
80
+ /**
81
+ * Options for capturing diagnostic topology failures.
82
+ */
83
+ diagnostics: DiagnosticsOptions;
84
+ /**
85
+ * Options for mapping final faces back to original input geometry IDs.
86
+ */
87
+ provenance: ProvenanceOptions;
88
+ /**
89
+ * An optional identifier for the input dataset.
90
+ */
91
+ input_profile_id?: string;
92
+ };
@@ -0,0 +1,4 @@
1
+ export type ProvenanceOptions = {
2
+ enabled: boolean;
3
+ include_boundary_line_ids: boolean;
4
+ };
@@ -0,0 +1 @@
1
+ export type SnapMode = "FloatExact" | "FloatEpsilonDedup" | "IntegerGrid";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Strategy for snapping coordinates to a grid.
3
+ *
4
+ * `Grid` applies a standard round-to-nearest integer grid policy `(coord / size).round() * size`.
5
+ * `GeosCompat` attempts to emulate GEOS / Shapely's `set_precision` behavior, which uses
6
+ * C++ std::round (rounding halfway cases away from zero).
7
+ *
8
+ * **Scale Guidance:**
9
+ * Use `Grid` for native Rust applications where absolute topological determinism and
10
+ * intuitive rounding is preferred.
11
+ * Use `GeosCompat` if you are using `geo-polygonize` to replace a Shapely / GEOS pipeline
12
+ * and require exact parity for edge cases at precision boundaries.
13
+ *
14
+ * **Expected Parity:**
15
+ * Rust's native `f64::round()` rounds halfway cases away from zero. This perfectly
16
+ * matches C++ `std::round` behavior, meaning that `Grid` and `GeosCompat` currently
17
+ * map identical values for basic single-coordinate precision points (e.g., `-0.5` => `-1.0`
18
+ * and `0.5` => `1.0`).
19
+ *
20
+ * **Expected Divergence:**
21
+ * The divergence between `Grid` and `GeosCompat` strategies typically arises under complex
22
+ * topological scaling sequences rather than simple single point coordinate rounding, but
23
+ * the option ensures the library remains semantically compatible with Python/C++ GEOS pipelines.
24
+ */
25
+ export type SnapStrategy = "Grid" | "GeosCompat";
@@ -0,0 +1 @@
1
+ export type TargetProfile = "Native" | "WasmSingleThread" | "WasmThreads";
@@ -0,0 +1 @@
1
+ export type TileOwnershipPolicy = "Centroid" | "RepresentativePointInsidePolygon" | "LexicographicMinVertex" | "CanonicalBoundaryHash";
@@ -0,0 +1,6 @@
1
+ import type { DedupPolicy } from "./DedupPolicy";
2
+ import type { TileOwnershipPolicy } from "./TileOwnershipPolicy";
3
+ export type TilingOptions = {
4
+ ownership_policy: TileOwnershipPolicy;
5
+ dedup_policy: DedupPolicy;
6
+ };
@@ -0,0 +1 @@
1
+ export type TouchPolicy = "AllowPointTouchDisallowEdgeShare" | "TreatAnyTouchAsDisjoint" | "AllowEdgeShare";
@@ -0,0 +1,4 @@
1
+ import type { ZPolicy } from "./ZPolicy";
2
+ export type ZOptions = {
3
+ policy: ZPolicy;
4
+ };
@@ -0,0 +1,5 @@
1
+ export type ZPolicy = "Ignore" | "InterpolateAlongEdge" | "PreferNearestEndpoint" | {
2
+ "ErrorOnConflict": {
3
+ max_delta: number;
4
+ };
5
+ };
@@ -1003,7 +1003,7 @@ async function __wbg_init(module_or_path) {
1003
1003
  }
1004
1004
 
1005
1005
  if (module_or_path === undefined) {
1006
- module_or_path = new URL('geo_polygonize_bg.wasm', import.meta.url);
1006
+ module_or_path = new URL(/* @vite-ignore */ 'geo_polygonize_bg.wasm', import.meta.url);
1007
1007
  }
1008
1008
  const imports = __wbg_get_imports();
1009
1009
 
@@ -17,4 +17,4 @@ export * from "./bindings/TouchPolicy";
17
17
  export * from "./bindings/ZOptions";
18
18
  export * from "./bindings/ZPolicy";
19
19
  export * from "./cfb";
20
- export declare function initBest(scalarModule: any, simdModule: any): Promise<typeof scalarExports>;
20
+ export declare function initBest(scalarModule: any, simdModule?: any): Promise<typeof scalarExports>;
@@ -0,0 +1,139 @@
1
+ import { PolygonizerOptions } from '../pkg-wrapper/bindings/PolygonizerOptions';
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ export class PolygonizerWasmError {
6
+ free(): void;
7
+ [Symbol.dispose](): void;
8
+ constructor(name: string, message: string);
9
+ readonly message: string;
10
+ readonly name: string;
11
+ }
12
+
13
+ export class WasmPolygonResult {
14
+ private constructor();
15
+ free(): void;
16
+ [Symbol.dispose](): void;
17
+ coords_len(): number;
18
+ coords_ptr(): number;
19
+ flat_line_ids_len(): number;
20
+ flat_line_ids_ptr(): number;
21
+ polygon_offsets_len(): number;
22
+ polygon_offsets_ptr(): number;
23
+ ring_offsets_len(): number;
24
+ ring_offsets_ptr(): number;
25
+ stride(): number;
26
+ readonly cut_edges: any;
27
+ readonly dangles: any;
28
+ readonly diagnostics: any;
29
+ readonly invalid_rings: any;
30
+ readonly provenance: any;
31
+ }
32
+
33
+ export function initThreadPool(num_threads: number): Promise<any>;
34
+
35
+ export function polygonize(geojson_str: string, node_input?: boolean | null, snap_grid_size?: number | null, extract_only_polygonal?: boolean | null, report_mode?: boolean | null): string;
36
+
37
+ /**
38
+ * Polygonizes an Arrow IPC stream containing a GeoArrow LineString array.
39
+ *
40
+ * This zero-copy path avoids JSON serialization overhead and returns a binary
41
+ * Arrow IPC stream containing a GeoArrow Polygon array. Requires the options
42
+ * to be passed as a parsed JS object.
43
+ */
44
+ export function polygonizeGeoArrowWithOptions(ipc_bytes: Uint8Array, options_val: Partial<PolygonizerOptions>): Uint8Array;
45
+
46
+ /**
47
+ * Polygonizes a GeoJSON FeatureCollection using the canonical `PolygonizerOptions`.
48
+ *
49
+ * This is the primary entry point for JavaScript users. It accepts a JSON string
50
+ * of options and returns a JSON string representing the result, including faces,
51
+ * dangles, cut-lines, and (optionally) provenance/diagnostics.
52
+ */
53
+ export function polygonizeWithOptions(geojson_str: string, options_val: Partial<PolygonizerOptions>): string;
54
+
55
+ export function polygonizeWithOptionsBuffer(coords: Float64Array, offsets: Uint32Array, stride: number, options_val: Partial<PolygonizerOptions>, line_ids?: Uint32Array | null): WasmPolygonResult;
56
+
57
+ export function polygonize_buffers(coords: Float64Array, offsets: Uint32Array, stride: number, node_input: boolean, snap_grid_size: number, line_ids?: Uint32Array | null): WasmPolygonResult;
58
+
59
+ export function polygonize_geoarrow(ipc_bytes: Uint8Array, node_input: boolean, snap_grid_size: number, extract_only_polygonal: boolean): Uint8Array;
60
+
61
+ export class wbg_rayon_PoolBuilder {
62
+ private constructor();
63
+ free(): void;
64
+ [Symbol.dispose](): void;
65
+ build(): void;
66
+ numThreads(): number;
67
+ receiver(): number;
68
+ }
69
+
70
+ export function wbg_rayon_start_worker(receiver: number): void;
71
+
72
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
73
+
74
+ export interface InitOutput {
75
+ readonly memory: WebAssembly.Memory;
76
+ readonly __wbg_polygonizerwasmerror_free: (a: number, b: number) => void;
77
+ readonly __wbg_wasmpolygonresult_free: (a: number, b: number) => void;
78
+ readonly polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
79
+ readonly polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
80
+ readonly polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
81
+ readonly polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
82
+ readonly polygonize_buffers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
83
+ readonly polygonize_geoarrow: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
84
+ readonly polygonizerwasmerror_message: (a: number) => [number, number];
85
+ readonly polygonizerwasmerror_name: (a: number) => [number, number];
86
+ readonly polygonizerwasmerror_new: (a: number, b: number, c: number, d: number) => number;
87
+ readonly wasmpolygonresult_coords_len: (a: number) => number;
88
+ readonly wasmpolygonresult_coords_ptr: (a: number) => number;
89
+ readonly wasmpolygonresult_cut_edges: (a: number) => any;
90
+ readonly wasmpolygonresult_dangles: (a: number) => any;
91
+ readonly wasmpolygonresult_diagnostics: (a: number) => any;
92
+ readonly wasmpolygonresult_flat_line_ids_len: (a: number) => number;
93
+ readonly wasmpolygonresult_flat_line_ids_ptr: (a: number) => number;
94
+ readonly wasmpolygonresult_invalid_rings: (a: number) => any;
95
+ readonly wasmpolygonresult_polygon_offsets_len: (a: number) => number;
96
+ readonly wasmpolygonresult_polygon_offsets_ptr: (a: number) => number;
97
+ readonly wasmpolygonresult_provenance: (a: number) => any;
98
+ readonly wasmpolygonresult_ring_offsets_len: (a: number) => number;
99
+ readonly wasmpolygonresult_ring_offsets_ptr: (a: number) => number;
100
+ readonly wasmpolygonresult_stride: (a: number) => number;
101
+ readonly polygonize_ffi: (a: number, b: number, c: number, d: number, e: number) => number;
102
+ readonly polygonize_with_options_ffi: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
103
+ readonly __wbg_wbg_rayon_poolbuilder_free: (a: number, b: number) => void;
104
+ readonly initThreadPool: (a: number) => any;
105
+ readonly wbg_rayon_poolbuilder_build: (a: number) => void;
106
+ readonly wbg_rayon_poolbuilder_numThreads: (a: number) => number;
107
+ readonly wbg_rayon_poolbuilder_receiver: (a: number) => number;
108
+ readonly wbg_rayon_start_worker: (a: number) => void;
109
+ readonly polygonize_result_free: () => void;
110
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
111
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
112
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
113
+ readonly __externref_table_alloc: () => number;
114
+ readonly __wbindgen_externrefs: WebAssembly.Table;
115
+ readonly __externref_table_dealloc: (a: number) => void;
116
+ readonly __wbindgen_start: () => void;
117
+ }
118
+
119
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
120
+
121
+ /**
122
+ * Instantiates the given `module`, which can either be bytes or
123
+ * a precompiled `WebAssembly.Module`.
124
+ *
125
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
126
+ *
127
+ * @returns {InitOutput}
128
+ */
129
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
130
+
131
+ /**
132
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
133
+ * for everything else, calls `WebAssembly.instantiate` directly.
134
+ *
135
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
136
+ *
137
+ * @returns {Promise<InitOutput>}
138
+ */
139
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,44 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const __wbg_polygonizerwasmerror_free: (a: number, b: number) => void;
5
+ export const __wbg_wasmpolygonresult_free: (a: number, b: number) => void;
6
+ export const polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
7
+ export const polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
8
+ export const polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
9
+ export const polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
10
+ export const polygonize_buffers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
11
+ export const polygonize_geoarrow: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
12
+ export const polygonizerwasmerror_message: (a: number) => [number, number];
13
+ export const polygonizerwasmerror_name: (a: number) => [number, number];
14
+ export const polygonizerwasmerror_new: (a: number, b: number, c: number, d: number) => number;
15
+ export const wasmpolygonresult_coords_len: (a: number) => number;
16
+ export const wasmpolygonresult_coords_ptr: (a: number) => number;
17
+ export const wasmpolygonresult_cut_edges: (a: number) => any;
18
+ export const wasmpolygonresult_dangles: (a: number) => any;
19
+ export const wasmpolygonresult_diagnostics: (a: number) => any;
20
+ export const wasmpolygonresult_flat_line_ids_len: (a: number) => number;
21
+ export const wasmpolygonresult_flat_line_ids_ptr: (a: number) => number;
22
+ export const wasmpolygonresult_invalid_rings: (a: number) => any;
23
+ export const wasmpolygonresult_polygon_offsets_len: (a: number) => number;
24
+ export const wasmpolygonresult_polygon_offsets_ptr: (a: number) => number;
25
+ export const wasmpolygonresult_provenance: (a: number) => any;
26
+ export const wasmpolygonresult_ring_offsets_len: (a: number) => number;
27
+ export const wasmpolygonresult_ring_offsets_ptr: (a: number) => number;
28
+ export const wasmpolygonresult_stride: (a: number) => number;
29
+ export const polygonize_ffi: (a: number, b: number, c: number, d: number, e: number) => number;
30
+ export const polygonize_with_options_ffi: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
31
+ export const __wbg_wbg_rayon_poolbuilder_free: (a: number, b: number) => void;
32
+ export const initThreadPool: (a: number) => any;
33
+ export const wbg_rayon_poolbuilder_build: (a: number) => void;
34
+ export const wbg_rayon_poolbuilder_numThreads: (a: number) => number;
35
+ export const wbg_rayon_poolbuilder_receiver: (a: number) => number;
36
+ export const wbg_rayon_start_worker: (a: number) => void;
37
+ export const polygonize_result_free: () => void;
38
+ export const __wbindgen_malloc: (a: number, b: number) => number;
39
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
40
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
41
+ export const __externref_table_alloc: () => number;
42
+ export const __wbindgen_externrefs: WebAssembly.Table;
43
+ export const __externref_table_dealloc: (a: number) => void;
44
+ export const __wbindgen_start: () => void;
@@ -0,0 +1,6 @@
1
+ import type { IndexBackend } from "./IndexBackend";
2
+ import type { TouchPolicy } from "./TouchPolicy";
3
+ export type ContainmentOptions = {
4
+ touch_policy: TouchPolicy;
5
+ index_backend: IndexBackend;
6
+ };
@@ -0,0 +1 @@
1
+ export type DedupPolicy = "KeepAll" | "CanonicalRingHash";
@@ -0,0 +1,5 @@
1
+ export type DeterminismOptions = {
2
+ canonical_sort: boolean;
3
+ canonical_ring_rotation: boolean;
4
+ stable_tie_breaks: boolean;
5
+ };
@@ -0,0 +1,4 @@
1
+ export type DiagnosticsOptions = {
2
+ enabled: boolean;
3
+ report_mode: boolean;
4
+ };
@@ -0,0 +1 @@
1
+ export type IndexBackend = "RStar" | "PackedNative";
@@ -0,0 +1 @@
1
+ export type NodingBackend = "Snap" | "Advanced";
@@ -0,0 +1,6 @@
1
+ import type { NodingBackend } from "./NodingBackend";
2
+ import type { SnapMode } from "./SnapMode";
3
+ export type NodingOptions = {
4
+ backend: NodingBackend;
5
+ snap_mode: SnapMode;
6
+ };