geo-polygonize 0.54.0 → 0.56.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.
Files changed (83) hide show
  1. package/dist/geo_polygonize.wasm +0 -0
  2. package/dist/geo_polygonize_simd.wasm +0 -0
  3. package/dist/slim/cjs/bindings/CoordinateFingerprintV1.d.ts +8 -0
  4. package/dist/slim/cjs/bindings/ErrorWitnessV1.d.ts +5 -0
  5. package/dist/slim/cjs/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  6. package/dist/slim/cjs/bindings/PolygonFingerprintV1.d.ts +12 -0
  7. package/dist/slim/cjs/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  8. package/dist/slim/cjs/bindings/RingFingerprintV1.d.ts +5 -0
  9. package/dist/slim/cjs/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  10. package/dist/slim/cjs/bindings/TopologyFingerprintV1.d.ts +18 -0
  11. package/dist/slim/cjs/index.d.ts +2 -0
  12. package/dist/slim/cjs/index_slim.js +35 -3
  13. package/dist/slim/es/bindings/CoordinateFingerprintV1.d.ts +8 -0
  14. package/dist/slim/es/bindings/ErrorWitnessV1.d.ts +5 -0
  15. package/dist/slim/es/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  16. package/dist/slim/es/bindings/PolygonFingerprintV1.d.ts +12 -0
  17. package/dist/slim/es/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  18. package/dist/slim/es/bindings/RingFingerprintV1.d.ts +5 -0
  19. package/dist/slim/es/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  20. package/dist/slim/es/bindings/TopologyFingerprintV1.d.ts +18 -0
  21. package/dist/slim/es/index.d.ts +2 -0
  22. package/dist/slim/es/index_slim.js +35 -4
  23. package/dist/slim/pkg-scalar/geo_polygonize.d.ts +12 -3
  24. package/dist/slim/pkg-scalar/geo_polygonize_bg.wasm.d.ts +1 -0
  25. package/dist/slim/pkg-wrapper/bindings/CoordinateFingerprintV1.d.ts +8 -0
  26. package/dist/slim/pkg-wrapper/bindings/ErrorWitnessV1.d.ts +5 -0
  27. package/dist/slim/pkg-wrapper/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  28. package/dist/slim/pkg-wrapper/bindings/PolygonFingerprintV1.d.ts +12 -0
  29. package/dist/slim/pkg-wrapper/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  30. package/dist/slim/pkg-wrapper/bindings/RingFingerprintV1.d.ts +5 -0
  31. package/dist/slim/pkg-wrapper/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  32. package/dist/slim/pkg-wrapper/bindings/TopologyFingerprintV1.d.ts +18 -0
  33. package/dist/standard/cjs/bindings/CoordinateFingerprintV1.d.ts +8 -0
  34. package/dist/standard/cjs/bindings/ErrorWitnessV1.d.ts +5 -0
  35. package/dist/standard/cjs/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  36. package/dist/standard/cjs/bindings/PolygonFingerprintV1.d.ts +12 -0
  37. package/dist/standard/cjs/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  38. package/dist/standard/cjs/bindings/RingFingerprintV1.d.ts +5 -0
  39. package/dist/standard/cjs/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  40. package/dist/standard/cjs/bindings/TopologyFingerprintV1.d.ts +18 -0
  41. package/dist/standard/cjs/index.d.ts +2 -0
  42. package/dist/standard/cjs/index.js +37 -5
  43. package/dist/standard/es/bindings/CoordinateFingerprintV1.d.ts +8 -0
  44. package/dist/standard/es/bindings/ErrorWitnessV1.d.ts +5 -0
  45. package/dist/standard/es/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  46. package/dist/standard/es/bindings/PolygonFingerprintV1.d.ts +12 -0
  47. package/dist/standard/es/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  48. package/dist/standard/es/bindings/RingFingerprintV1.d.ts +5 -0
  49. package/dist/standard/es/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  50. package/dist/standard/es/bindings/TopologyFingerprintV1.d.ts +18 -0
  51. package/dist/standard/es/index.d.ts +2 -0
  52. package/dist/standard/es/index.js +37 -6
  53. package/dist/standard/pkg-scalar/geo_polygonize.d.ts +12 -3
  54. package/dist/standard/pkg-scalar/geo_polygonize_bg.wasm.d.ts +1 -0
  55. package/dist/standard/pkg-wrapper/bindings/CoordinateFingerprintV1.d.ts +8 -0
  56. package/dist/standard/pkg-wrapper/bindings/ErrorWitnessV1.d.ts +5 -0
  57. package/dist/standard/pkg-wrapper/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  58. package/dist/standard/pkg-wrapper/bindings/PolygonFingerprintV1.d.ts +12 -0
  59. package/dist/standard/pkg-wrapper/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  60. package/dist/standard/pkg-wrapper/bindings/RingFingerprintV1.d.ts +5 -0
  61. package/dist/standard/pkg-wrapper/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  62. package/dist/standard/pkg-wrapper/bindings/TopologyFingerprintV1.d.ts +18 -0
  63. package/dist/threads/es/bindings/CoordinateFingerprintV1.d.ts +8 -0
  64. package/dist/threads/es/bindings/ErrorWitnessV1.d.ts +5 -0
  65. package/dist/threads/es/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  66. package/dist/threads/es/bindings/PolygonFingerprintV1.d.ts +12 -0
  67. package/dist/threads/es/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  68. package/dist/threads/es/bindings/RingFingerprintV1.d.ts +5 -0
  69. package/dist/threads/es/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  70. package/dist/threads/es/bindings/TopologyFingerprintV1.d.ts +18 -0
  71. package/dist/threads/es/index.d.ts +2 -0
  72. package/dist/threads/es/index.js +35 -4
  73. package/dist/threads/pkg-threads/geo_polygonize.d.ts +12 -3
  74. package/dist/threads/pkg-threads/geo_polygonize_bg.wasm.d.ts +1 -0
  75. package/dist/threads/pkg-wrapper/bindings/CoordinateFingerprintV1.d.ts +8 -0
  76. package/dist/threads/pkg-wrapper/bindings/ErrorWitnessV1.d.ts +5 -0
  77. package/dist/threads/pkg-wrapper/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  78. package/dist/threads/pkg-wrapper/bindings/PolygonFingerprintV1.d.ts +12 -0
  79. package/dist/threads/pkg-wrapper/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  80. package/dist/threads/pkg-wrapper/bindings/RingFingerprintV1.d.ts +5 -0
  81. package/dist/threads/pkg-wrapper/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  82. package/dist/threads/pkg-wrapper/bindings/TopologyFingerprintV1.d.ts +18 -0
  83. package/package.json +1 -1
@@ -47,12 +47,20 @@ export function polygonizeFingerprintWithOptions(geojson_str: string, options_va
47
47
  */
48
48
  export function polygonizeGeoArrowWithOptions(ipc_bytes: Uint8Array, options_val: Partial<PolygonizerOptions>): Uint8Array;
49
49
 
50
+ /**
51
+ * Returns the complete versioned topology report for a GeoJSON canonical-options call.
52
+ *
53
+ * The report is the JSON serialization of `TopologyFingerprintV1`; it is the
54
+ * stable cross-binding success contract, not a polygon-only GeoJSON projection.
55
+ */
56
+ export function polygonizeReportWithOptions(geojson_str: string, options_val: Partial<PolygonizerOptions>): string;
57
+
50
58
  /**
51
59
  * Polygonizes a GeoJSON FeatureCollection using the canonical `PolygonizerOptions`.
52
60
  *
53
- * This is the primary entry point for JavaScript users. It accepts a JSON string
54
- * of options and returns a JSON string representing the result, including faces,
55
- * dangles, cut-lines, and (optionally) provenance/diagnostics.
61
+ * This compatibility entry point returns polygons only. Use
62
+ * [`polygonize_report_with_options_js`] when dangles, cut edges, invalid rings,
63
+ * provenance, diagnostics, and exact coordinate encoding are required.
56
64
  */
57
65
  export function polygonizeWithOptions(geojson_str: string, options_val: Partial<PolygonizerOptions>): string;
58
66
 
@@ -71,6 +79,7 @@ export interface InitOutput {
71
79
  readonly polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
72
80
  readonly polygonizeFingerprintWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
73
81
  readonly polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
82
+ readonly polygonizeReportWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
74
83
  readonly polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
75
84
  readonly polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
76
85
  readonly polygonize_buffers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
@@ -6,6 +6,7 @@ export const __wbg_wasmpolygonresult_free: (a: number, b: number) => void;
6
6
  export const polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
7
7
  export const polygonizeFingerprintWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
8
8
  export const polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
9
+ export const polygonizeReportWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
9
10
  export const polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
10
11
  export const polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
11
12
  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];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An exact finite coordinate. Every component is an IEEE-754 bit pattern.
3
+ */
4
+ export type CoordinateFingerprintV1 = {
5
+ x: string;
6
+ y: string;
7
+ z: string;
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type ErrorWitnessV1 = {
3
+ ids: Array<string>;
4
+ coordinate: CoordinateFingerprintV1 | null;
5
+ };
@@ -0,0 +1,16 @@
1
+ import type { ErrorWitnessV1 } from "./ErrorWitnessV1";
2
+ /**
3
+ * A structured, stable error equality contract.
4
+ */
5
+ export type NormalizedPolygonizeErrorV1 = {
6
+ schema_version: number;
7
+ family: string;
8
+ code: string;
9
+ stage: string;
10
+ field: string | null;
11
+ expected: string | null;
12
+ actual: string | null;
13
+ limit: string | null;
14
+ observed: string | null;
15
+ witness: ErrorWitnessV1 | null;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { ProvenanceFingerprintV1 } from "./ProvenanceFingerprintV1";
3
+ import type { RingFingerprintV1 } from "./RingFingerprintV1";
4
+ export type PolygonFingerprintV1 = {
5
+ exterior: Array<CoordinateFingerprintV1>;
6
+ interiors: Array<RingFingerprintV1>;
7
+ /**
8
+ * Per-edge representative input IDs, encoded as fixed-width hex strings.
9
+ */
10
+ exterior_edge_ids: Array<string>;
11
+ provenance: ProvenanceFingerprintV1 | null;
12
+ };
@@ -0,0 +1,7 @@
1
+ export type ProvenanceFingerprintV1 = {
2
+ /**
3
+ * Complete source sets, never JSON numbers, so JavaScript cannot lose IDs.
4
+ */
5
+ boundary_line_ids: Array<string>;
6
+ input_profile_id: string | null;
7
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type RingFingerprintV1 = {
3
+ coordinates: Array<CoordinateFingerprintV1>;
4
+ edge_ids: Array<string>;
5
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Only topology-level diagnostics. Timings and work counters are deliberately excluded.
3
+ */
4
+ export type TopologyDiagnosticsFingerprintV1 = {
5
+ dangle_count: number;
6
+ cut_edge_count: number;
7
+ ring_count: number;
8
+ shell_count: number;
9
+ hole_count: number;
10
+ unassigned_hole_count: number;
11
+ unassigned_hole_area: string;
12
+ invalid_ring_count: number;
13
+ z_conflict_node_count: number;
14
+ z_conflicting_line_ids: Array<string>;
15
+ };
@@ -0,0 +1,18 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { PolygonFingerprintV1 } from "./PolygonFingerprintV1";
3
+ import type { TopologyDiagnosticsFingerprintV1 } from "./TopologyDiagnosticsFingerprintV1";
4
+ /**
5
+ * A versioned, structured canonical representation of a successful run.
6
+ */
7
+ export type TopologyFingerprintV1 = {
8
+ schema_version: number;
9
+ /**
10
+ * The serialized canonical options object is part of the semantic contract.
11
+ */
12
+ options: unknown;
13
+ polygons: Array<PolygonFingerprintV1>;
14
+ dangles: Array<Array<CoordinateFingerprintV1>>;
15
+ cut_edges: Array<Array<CoordinateFingerprintV1>>;
16
+ invalid_rings: Array<Array<CoordinateFingerprintV1>>;
17
+ diagnostics: TopologyDiagnosticsFingerprintV1 | null;
18
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An exact finite coordinate. Every component is an IEEE-754 bit pattern.
3
+ */
4
+ export type CoordinateFingerprintV1 = {
5
+ x: string;
6
+ y: string;
7
+ z: string;
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type ErrorWitnessV1 = {
3
+ ids: Array<string>;
4
+ coordinate: CoordinateFingerprintV1 | null;
5
+ };
@@ -0,0 +1,16 @@
1
+ import type { ErrorWitnessV1 } from "./ErrorWitnessV1";
2
+ /**
3
+ * A structured, stable error equality contract.
4
+ */
5
+ export type NormalizedPolygonizeErrorV1 = {
6
+ schema_version: number;
7
+ family: string;
8
+ code: string;
9
+ stage: string;
10
+ field: string | null;
11
+ expected: string | null;
12
+ actual: string | null;
13
+ limit: string | null;
14
+ observed: string | null;
15
+ witness: ErrorWitnessV1 | null;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { ProvenanceFingerprintV1 } from "./ProvenanceFingerprintV1";
3
+ import type { RingFingerprintV1 } from "./RingFingerprintV1";
4
+ export type PolygonFingerprintV1 = {
5
+ exterior: Array<CoordinateFingerprintV1>;
6
+ interiors: Array<RingFingerprintV1>;
7
+ /**
8
+ * Per-edge representative input IDs, encoded as fixed-width hex strings.
9
+ */
10
+ exterior_edge_ids: Array<string>;
11
+ provenance: ProvenanceFingerprintV1 | null;
12
+ };
@@ -0,0 +1,7 @@
1
+ export type ProvenanceFingerprintV1 = {
2
+ /**
3
+ * Complete source sets, never JSON numbers, so JavaScript cannot lose IDs.
4
+ */
5
+ boundary_line_ids: Array<string>;
6
+ input_profile_id: string | null;
7
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type RingFingerprintV1 = {
3
+ coordinates: Array<CoordinateFingerprintV1>;
4
+ edge_ids: Array<string>;
5
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Only topology-level diagnostics. Timings and work counters are deliberately excluded.
3
+ */
4
+ export type TopologyDiagnosticsFingerprintV1 = {
5
+ dangle_count: number;
6
+ cut_edge_count: number;
7
+ ring_count: number;
8
+ shell_count: number;
9
+ hole_count: number;
10
+ unassigned_hole_count: number;
11
+ unassigned_hole_area: string;
12
+ invalid_ring_count: number;
13
+ z_conflict_node_count: number;
14
+ z_conflicting_line_ids: Array<string>;
15
+ };
@@ -0,0 +1,18 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { PolygonFingerprintV1 } from "./PolygonFingerprintV1";
3
+ import type { TopologyDiagnosticsFingerprintV1 } from "./TopologyDiagnosticsFingerprintV1";
4
+ /**
5
+ * A versioned, structured canonical representation of a successful run.
6
+ */
7
+ export type TopologyFingerprintV1 = {
8
+ schema_version: number;
9
+ /**
10
+ * The serialized canonical options object is part of the semantic contract.
11
+ */
12
+ options: unknown;
13
+ polygons: Array<PolygonFingerprintV1>;
14
+ dangles: Array<Array<CoordinateFingerprintV1>>;
15
+ cut_edges: Array<Array<CoordinateFingerprintV1>>;
16
+ invalid_rings: Array<Array<CoordinateFingerprintV1>>;
17
+ diagnostics: TopologyDiagnosticsFingerprintV1 | null;
18
+ };
@@ -15,5 +15,7 @@ export * from "./bindings/TileOwnershipPolicy";
15
15
  export * from "./bindings/TouchPolicy";
16
16
  export * from "./bindings/ZOptions";
17
17
  export * from "./bindings/ZPolicy";
18
+ export * from "./bindings/TopologyFingerprintV1";
19
+ export * from "./bindings/NormalizedPolygonizeErrorV1";
18
20
  export * from "./cfb";
19
21
  export default function init(_input?: any): Promise<typeof exports>;
@@ -377,12 +377,42 @@ function polygonizeGeoArrowWithOptions(ipc_bytes, options_val) {
377
377
  return v2;
378
378
  }
379
379
 
380
+ /**
381
+ * Returns the complete versioned topology report for a GeoJSON canonical-options call.
382
+ *
383
+ * The report is the JSON serialization of `TopologyFingerprintV1`; it is the
384
+ * stable cross-binding success contract, not a polygon-only GeoJSON projection.
385
+ * @param {string} geojson_str
386
+ * @param {any} options_val
387
+ * @returns {string}
388
+ */
389
+ function polygonizeReportWithOptions(geojson_str, options_val) {
390
+ let deferred3_0;
391
+ let deferred3_1;
392
+ try {
393
+ const ptr0 = passStringToWasm0(geojson_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
394
+ const len0 = WASM_VECTOR_LEN;
395
+ const ret = wasm.polygonizeReportWithOptions(ptr0, len0, options_val);
396
+ var ptr2 = ret[0];
397
+ var len2 = ret[1];
398
+ if (ret[3]) {
399
+ ptr2 = 0; len2 = 0;
400
+ throw takeFromExternrefTable0(ret[2]);
401
+ }
402
+ deferred3_0 = ptr2;
403
+ deferred3_1 = len2;
404
+ return getStringFromWasm0(ptr2, len2);
405
+ } finally {
406
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
407
+ }
408
+ }
409
+
380
410
  /**
381
411
  * Polygonizes a GeoJSON FeatureCollection using the canonical `PolygonizerOptions`.
382
412
  *
383
- * This is the primary entry point for JavaScript users. It accepts a JSON string
384
- * of options and returns a JSON string representing the result, including faces,
385
- * dangles, cut-lines, and (optionally) provenance/diagnostics.
413
+ * This compatibility entry point returns polygons only. Use
414
+ * [`polygonize_report_with_options_js`] when dangles, cut edges, invalid rings,
415
+ * provenance, diagnostics, and exact coordinate encoding are required.
386
416
  * @param {string} geojson_str
387
417
  * @param {any} options_val
388
418
  * @returns {string}
@@ -1172,6 +1202,7 @@ var geo_polygonize = /*#__PURE__*/Object.freeze({
1172
1202
  polygonize: polygonize,
1173
1203
  polygonizeFingerprintWithOptions: polygonizeFingerprintWithOptions,
1174
1204
  polygonizeGeoArrowWithOptions: polygonizeGeoArrowWithOptions,
1205
+ polygonizeReportWithOptions: polygonizeReportWithOptions,
1175
1206
  polygonizeWithOptions: polygonizeWithOptions,
1176
1207
  polygonizeWithOptionsBuffer: polygonizeWithOptionsBuffer,
1177
1208
  polygonize_buffers: polygonize_buffers,
@@ -1217,4 +1248,4 @@ const cfbRobustOptions = {
1217
1248
  input_profile_id: "cfb_robust_v1",
1218
1249
  };
1219
1250
 
1220
- export { PolygonizerWasmError, WasmPolygonResult, cfbRobustOptions, __wbg_init as default, initSync, initThreadPool, polygonize, polygonizeFingerprintWithOptions, polygonizeGeoArrowWithOptions, polygonizeWithOptions, polygonizeWithOptionsBuffer, polygonize_buffers, polygonize_geoarrow, wbg_rayon_PoolBuilder, wbg_rayon_start_worker };
1251
+ export { PolygonizerWasmError, WasmPolygonResult, cfbRobustOptions, __wbg_init as default, initSync, initThreadPool, polygonize, polygonizeFingerprintWithOptions, polygonizeGeoArrowWithOptions, polygonizeReportWithOptions, polygonizeWithOptions, polygonizeWithOptionsBuffer, polygonize_buffers, polygonize_geoarrow, wbg_rayon_PoolBuilder, wbg_rayon_start_worker };
@@ -49,12 +49,20 @@ export function polygonizeFingerprintWithOptions(geojson_str: string, options_va
49
49
  */
50
50
  export function polygonizeGeoArrowWithOptions(ipc_bytes: Uint8Array, options_val: Partial<PolygonizerOptions>): Uint8Array;
51
51
 
52
+ /**
53
+ * Returns the complete versioned topology report for a GeoJSON canonical-options call.
54
+ *
55
+ * The report is the JSON serialization of `TopologyFingerprintV1`; it is the
56
+ * stable cross-binding success contract, not a polygon-only GeoJSON projection.
57
+ */
58
+ export function polygonizeReportWithOptions(geojson_str: string, options_val: Partial<PolygonizerOptions>): string;
59
+
52
60
  /**
53
61
  * Polygonizes a GeoJSON FeatureCollection using the canonical `PolygonizerOptions`.
54
62
  *
55
- * This is the primary entry point for JavaScript users. It accepts a JSON string
56
- * of options and returns a JSON string representing the result, including faces,
57
- * dangles, cut-lines, and (optionally) provenance/diagnostics.
63
+ * This compatibility entry point returns polygons only. Use
64
+ * [`polygonize_report_with_options_js`] when dangles, cut edges, invalid rings,
65
+ * provenance, diagnostics, and exact coordinate encoding are required.
58
66
  */
59
67
  export function polygonizeWithOptions(geojson_str: string, options_val: Partial<PolygonizerOptions>): string;
60
68
 
@@ -83,6 +91,7 @@ export interface InitOutput {
83
91
  readonly polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
84
92
  readonly polygonizeFingerprintWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
85
93
  readonly polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
94
+ readonly polygonizeReportWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
86
95
  readonly polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
87
96
  readonly polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
88
97
  readonly polygonize_buffers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
@@ -5,6 +5,7 @@ export const __wbg_wasmpolygonresult_free: (a: number, b: number) => void;
5
5
  export const polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
6
6
  export const polygonizeFingerprintWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
7
7
  export const polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
8
+ export const polygonizeReportWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
8
9
  export const polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
9
10
  export const polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
10
11
  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];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An exact finite coordinate. Every component is an IEEE-754 bit pattern.
3
+ */
4
+ export type CoordinateFingerprintV1 = {
5
+ x: string;
6
+ y: string;
7
+ z: string;
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type ErrorWitnessV1 = {
3
+ ids: Array<string>;
4
+ coordinate: CoordinateFingerprintV1 | null;
5
+ };
@@ -0,0 +1,16 @@
1
+ import type { ErrorWitnessV1 } from "./ErrorWitnessV1";
2
+ /**
3
+ * A structured, stable error equality contract.
4
+ */
5
+ export type NormalizedPolygonizeErrorV1 = {
6
+ schema_version: number;
7
+ family: string;
8
+ code: string;
9
+ stage: string;
10
+ field: string | null;
11
+ expected: string | null;
12
+ actual: string | null;
13
+ limit: string | null;
14
+ observed: string | null;
15
+ witness: ErrorWitnessV1 | null;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { ProvenanceFingerprintV1 } from "./ProvenanceFingerprintV1";
3
+ import type { RingFingerprintV1 } from "./RingFingerprintV1";
4
+ export type PolygonFingerprintV1 = {
5
+ exterior: Array<CoordinateFingerprintV1>;
6
+ interiors: Array<RingFingerprintV1>;
7
+ /**
8
+ * Per-edge representative input IDs, encoded as fixed-width hex strings.
9
+ */
10
+ exterior_edge_ids: Array<string>;
11
+ provenance: ProvenanceFingerprintV1 | null;
12
+ };
@@ -0,0 +1,7 @@
1
+ export type ProvenanceFingerprintV1 = {
2
+ /**
3
+ * Complete source sets, never JSON numbers, so JavaScript cannot lose IDs.
4
+ */
5
+ boundary_line_ids: Array<string>;
6
+ input_profile_id: string | null;
7
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type RingFingerprintV1 = {
3
+ coordinates: Array<CoordinateFingerprintV1>;
4
+ edge_ids: Array<string>;
5
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Only topology-level diagnostics. Timings and work counters are deliberately excluded.
3
+ */
4
+ export type TopologyDiagnosticsFingerprintV1 = {
5
+ dangle_count: number;
6
+ cut_edge_count: number;
7
+ ring_count: number;
8
+ shell_count: number;
9
+ hole_count: number;
10
+ unassigned_hole_count: number;
11
+ unassigned_hole_area: string;
12
+ invalid_ring_count: number;
13
+ z_conflict_node_count: number;
14
+ z_conflicting_line_ids: Array<string>;
15
+ };
@@ -0,0 +1,18 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { PolygonFingerprintV1 } from "./PolygonFingerprintV1";
3
+ import type { TopologyDiagnosticsFingerprintV1 } from "./TopologyDiagnosticsFingerprintV1";
4
+ /**
5
+ * A versioned, structured canonical representation of a successful run.
6
+ */
7
+ export type TopologyFingerprintV1 = {
8
+ schema_version: number;
9
+ /**
10
+ * The serialized canonical options object is part of the semantic contract.
11
+ */
12
+ options: unknown;
13
+ polygons: Array<PolygonFingerprintV1>;
14
+ dangles: Array<Array<CoordinateFingerprintV1>>;
15
+ cut_edges: Array<Array<CoordinateFingerprintV1>>;
16
+ invalid_rings: Array<Array<CoordinateFingerprintV1>>;
17
+ diagnostics: TopologyDiagnosticsFingerprintV1 | null;
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geo-polygonize",
3
- "version": "0.54.0",
3
+ "version": "0.56.0",
4
4
  "description": "A native Rust port of the JTS/GEOS polygonization algorithm (Wasm)",
5
5
  "type": "module",
6
6
  "scripts": {