geo-polygonize 0.36.2 → 0.39.2

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 (51) hide show
  1. package/README.md +9 -3
  2. package/dist/geo_polygonize.wasm +0 -0
  3. package/dist/geo_polygonize_simd.wasm +0 -0
  4. package/dist/slim/cjs/bindings/PolygonizerOptions.d.ts +1 -1
  5. package/dist/slim/cjs/bindings/SnapStrategy.d.ts +9 -19
  6. package/dist/slim/cjs/index.d.ts +0 -1
  7. package/dist/slim/cjs/index_slim.d.ts +0 -1
  8. package/dist/slim/cjs/index_slim.js +1 -1
  9. package/dist/slim/cjs/index_threads.d.ts +0 -1
  10. package/dist/slim/es/bindings/PolygonizerOptions.d.ts +1 -1
  11. package/dist/slim/es/bindings/SnapStrategy.d.ts +9 -19
  12. package/dist/slim/es/index.d.ts +0 -1
  13. package/dist/slim/es/index_slim.d.ts +0 -1
  14. package/dist/slim/es/index_slim.js +1 -1
  15. package/dist/slim/es/index_threads.d.ts +0 -1
  16. package/dist/slim/pkg-scalar/geo_polygonize.d.ts +1 -1
  17. package/dist/slim/pkg-wrapper/bindings/PolygonizerOptions.d.ts +1 -1
  18. package/dist/slim/pkg-wrapper/bindings/SnapStrategy.d.ts +9 -19
  19. package/dist/standard/cjs/bindings/PolygonizerOptions.d.ts +1 -1
  20. package/dist/standard/cjs/bindings/SnapStrategy.d.ts +9 -19
  21. package/dist/standard/cjs/index.d.ts +0 -1
  22. package/dist/standard/cjs/index.js +3 -3
  23. package/dist/standard/cjs/index_slim.d.ts +0 -1
  24. package/dist/standard/cjs/index_threads.d.ts +0 -1
  25. package/dist/standard/es/bindings/PolygonizerOptions.d.ts +1 -1
  26. package/dist/standard/es/bindings/SnapStrategy.d.ts +9 -19
  27. package/dist/standard/es/index.d.ts +0 -1
  28. package/dist/standard/es/index.js +3 -3
  29. package/dist/standard/es/index_slim.d.ts +0 -1
  30. package/dist/standard/es/index_threads.d.ts +0 -1
  31. package/dist/standard/pkg-scalar/geo_polygonize.d.ts +1 -1
  32. package/dist/standard/pkg-wrapper/bindings/PolygonizerOptions.d.ts +1 -1
  33. package/dist/standard/pkg-wrapper/bindings/SnapStrategy.d.ts +9 -19
  34. package/dist/threads/es/bindings/PolygonizerOptions.d.ts +1 -1
  35. package/dist/threads/es/bindings/SnapStrategy.d.ts +9 -19
  36. package/dist/threads/es/index.d.ts +0 -1
  37. package/dist/threads/es/index.js +1 -1
  38. package/dist/threads/es/index_slim.d.ts +0 -1
  39. package/dist/threads/es/index_threads.d.ts +0 -1
  40. package/dist/threads/pkg-threads/geo_polygonize.d.ts +1 -1
  41. package/dist/threads/pkg-wrapper/bindings/PolygonizerOptions.d.ts +1 -1
  42. package/dist/threads/pkg-wrapper/bindings/SnapStrategy.d.ts +9 -19
  43. package/package.json +1 -1
  44. package/dist/slim/cjs/bindings/TilingOptions.d.ts +0 -6
  45. package/dist/slim/es/bindings/TilingOptions.d.ts +0 -6
  46. package/dist/slim/pkg-wrapper/bindings/TilingOptions.d.ts +0 -6
  47. package/dist/standard/cjs/bindings/TilingOptions.d.ts +0 -6
  48. package/dist/standard/es/bindings/TilingOptions.d.ts +0 -6
  49. package/dist/standard/pkg-wrapper/bindings/TilingOptions.d.ts +0 -6
  50. package/dist/threads/es/bindings/TilingOptions.d.ts +0 -6
  51. package/dist/threads/pkg-wrapper/bindings/TilingOptions.d.ts +0 -6
@@ -9,7 +9,6 @@ export * from "./bindings/NodingOptions";
9
9
  export * from "./bindings/ProvenanceOptions";
10
10
  export * from "./bindings/SnapStrategy";
11
11
  export * from "./bindings/TileOwnershipPolicy";
12
- export * from "./bindings/TilingOptions";
13
12
  export * from "./bindings/TouchPolicy";
14
13
  export * from "./cfb";
15
14
  export declare function initBest(scalarModule: any, simdModule?: any): Promise<typeof scalarExports>;
@@ -9,7 +9,6 @@ export * from "./bindings/NodingOptions";
9
9
  export * from "./bindings/ProvenanceOptions";
10
10
  export * from "./bindings/SnapStrategy";
11
11
  export * from "./bindings/TileOwnershipPolicy";
12
- export * from "./bindings/TilingOptions";
13
12
  export * from "./bindings/TouchPolicy";
14
13
  export * from "./cfb";
15
14
  export default init;
@@ -35,7 +35,7 @@ export function polygonize(geojson_str: string, node_input?: boolean | null, sna
35
35
  /**
36
36
  * Polygonizes an Arrow IPC stream containing a GeoArrow LineString array.
37
37
  *
38
- * This zero-copy path avoids JSON serialization overhead and returns a binary
38
+ * This binary path avoids JSON serialization overhead and returns an
39
39
  * Arrow IPC stream containing a GeoArrow Polygon array. Requires the options
40
40
  * to be passed as a parsed JS object.
41
41
  */
@@ -49,7 +49,7 @@ export type PolygonizerOptions = {
49
49
  */
50
50
  extract_only_polygonal: boolean;
51
51
  /**
52
- * The underlying strategy to apply when snapping coordinate geometries.
52
+ * Controls robust snap noding and output coordinate handling.
53
53
  *
54
54
  * See `SnapStrategy` for differences between strict `Grid` snapping and
55
55
  * Shapely/GEOS `GeosCompat` strategies.
@@ -1,25 +1,15 @@
1
1
  /**
2
- * Strategy for snapping coordinates to a grid.
2
+ * Strategy for robust snap noding and output coordinates.
3
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).
4
+ * `Grid` uses the precision grid for both topology and output coordinates.
5
+ * `GeosCompat` uses the grid for topology, then restores one deterministic nearest source
6
+ * coordinate per snapped node. This targets Shapely-style `snap` followed by full-precision
7
+ * noding and polygonization; it does not emulate `set_precision` output.
7
8
  *
8
9
  * **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.
10
+ * Use `Grid` when an explicit precision model is the desired output contract.
11
+ * Use `GeosCompat` when the grid is a robustness aid but source-coordinate fidelity matters.
12
+ * Both strategies are deterministic; exact GEOS/Shapely parity is not guaranteed for
13
+ * degenerate or many-to-one snaps.
24
14
  */
25
15
  export type SnapStrategy = "Grid" | "GeosCompat";
@@ -49,7 +49,7 @@ export type PolygonizerOptions = {
49
49
  */
50
50
  extract_only_polygonal: boolean;
51
51
  /**
52
- * The underlying strategy to apply when snapping coordinate geometries.
52
+ * Controls robust snap noding and output coordinate handling.
53
53
  *
54
54
  * See `SnapStrategy` for differences between strict `Grid` snapping and
55
55
  * Shapely/GEOS `GeosCompat` strategies.
@@ -1,25 +1,15 @@
1
1
  /**
2
- * Strategy for snapping coordinates to a grid.
2
+ * Strategy for robust snap noding and output coordinates.
3
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).
4
+ * `Grid` uses the precision grid for both topology and output coordinates.
5
+ * `GeosCompat` uses the grid for topology, then restores one deterministic nearest source
6
+ * coordinate per snapped node. This targets Shapely-style `snap` followed by full-precision
7
+ * noding and polygonization; it does not emulate `set_precision` output.
7
8
  *
8
9
  * **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.
10
+ * Use `Grid` when an explicit precision model is the desired output contract.
11
+ * Use `GeosCompat` when the grid is a robustness aid but source-coordinate fidelity matters.
12
+ * Both strategies are deterministic; exact GEOS/Shapely parity is not guaranteed for
13
+ * degenerate or many-to-one snaps.
24
14
  */
25
15
  export type SnapStrategy = "Grid" | "GeosCompat";
@@ -9,7 +9,6 @@ export * from "./bindings/NodingOptions";
9
9
  export * from "./bindings/ProvenanceOptions";
10
10
  export * from "./bindings/SnapStrategy";
11
11
  export * from "./bindings/TileOwnershipPolicy";
12
- export * from "./bindings/TilingOptions";
13
12
  export * from "./bindings/TouchPolicy";
14
13
  export * from "./cfb";
15
14
  export default function init(_input?: any): Promise<typeof exports>;
@@ -324,7 +324,7 @@ function polygonize(geojson_str, node_input, snap_grid_size, extract_only_polygo
324
324
  /**
325
325
  * Polygonizes an Arrow IPC stream containing a GeoArrow LineString array.
326
326
  *
327
- * This zero-copy path avoids JSON serialization overhead and returns a binary
327
+ * This binary path avoids JSON serialization overhead and returns an
328
328
  * Arrow IPC stream containing a GeoArrow Polygon array. Requires the options
329
329
  * to be passed as a parsed JS object.
330
330
  * @param {Uint8Array} ipc_bytes
@@ -9,7 +9,6 @@ export * from "./bindings/NodingOptions";
9
9
  export * from "./bindings/ProvenanceOptions";
10
10
  export * from "./bindings/SnapStrategy";
11
11
  export * from "./bindings/TileOwnershipPolicy";
12
- export * from "./bindings/TilingOptions";
13
12
  export * from "./bindings/TouchPolicy";
14
13
  export * from "./cfb";
15
14
  export declare function initBest(scalarModule: any, simdModule?: any): Promise<typeof scalarExports>;
@@ -9,7 +9,6 @@ export * from "./bindings/NodingOptions";
9
9
  export * from "./bindings/ProvenanceOptions";
10
10
  export * from "./bindings/SnapStrategy";
11
11
  export * from "./bindings/TileOwnershipPolicy";
12
- export * from "./bindings/TilingOptions";
13
12
  export * from "./bindings/TouchPolicy";
14
13
  export * from "./cfb";
15
14
  export default init;
@@ -37,7 +37,7 @@ export function polygonize(geojson_str: string, node_input?: boolean | null, sna
37
37
  /**
38
38
  * Polygonizes an Arrow IPC stream containing a GeoArrow LineString array.
39
39
  *
40
- * This zero-copy path avoids JSON serialization overhead and returns a binary
40
+ * This binary path avoids JSON serialization overhead and returns an
41
41
  * Arrow IPC stream containing a GeoArrow Polygon array. Requires the options
42
42
  * to be passed as a parsed JS object.
43
43
  */
@@ -49,7 +49,7 @@ export type PolygonizerOptions = {
49
49
  */
50
50
  extract_only_polygonal: boolean;
51
51
  /**
52
- * The underlying strategy to apply when snapping coordinate geometries.
52
+ * Controls robust snap noding and output coordinate handling.
53
53
  *
54
54
  * See `SnapStrategy` for differences between strict `Grid` snapping and
55
55
  * Shapely/GEOS `GeosCompat` strategies.
@@ -1,25 +1,15 @@
1
1
  /**
2
- * Strategy for snapping coordinates to a grid.
2
+ * Strategy for robust snap noding and output coordinates.
3
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).
4
+ * `Grid` uses the precision grid for both topology and output coordinates.
5
+ * `GeosCompat` uses the grid for topology, then restores one deterministic nearest source
6
+ * coordinate per snapped node. This targets Shapely-style `snap` followed by full-precision
7
+ * noding and polygonization; it does not emulate `set_precision` output.
7
8
  *
8
9
  * **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.
10
+ * Use `Grid` when an explicit precision model is the desired output contract.
11
+ * Use `GeosCompat` when the grid is a robustness aid but source-coordinate fidelity matters.
12
+ * Both strategies are deterministic; exact GEOS/Shapely parity is not guaranteed for
13
+ * degenerate or many-to-one snaps.
24
14
  */
25
15
  export type SnapStrategy = "Grid" | "GeosCompat";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geo-polygonize",
3
- "version": "0.36.2",
3
+ "version": "0.39.2",
4
4
  "description": "A native Rust port of the JTS/GEOS polygonization algorithm (Wasm)",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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
- };