geo-polygonize 0.36.2 → 0.39.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 (45) hide show
  1. package/README.md +6 -0
  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_threads.d.ts +0 -1
  9. package/dist/slim/es/bindings/PolygonizerOptions.d.ts +1 -1
  10. package/dist/slim/es/bindings/SnapStrategy.d.ts +9 -19
  11. package/dist/slim/es/index.d.ts +0 -1
  12. package/dist/slim/es/index_slim.d.ts +0 -1
  13. package/dist/slim/es/index_threads.d.ts +0 -1
  14. package/dist/slim/pkg-wrapper/bindings/PolygonizerOptions.d.ts +1 -1
  15. package/dist/slim/pkg-wrapper/bindings/SnapStrategy.d.ts +9 -19
  16. package/dist/standard/cjs/bindings/PolygonizerOptions.d.ts +1 -1
  17. package/dist/standard/cjs/bindings/SnapStrategy.d.ts +9 -19
  18. package/dist/standard/cjs/index.d.ts +0 -1
  19. package/dist/standard/cjs/index.js +2 -2
  20. package/dist/standard/cjs/index_slim.d.ts +0 -1
  21. package/dist/standard/cjs/index_threads.d.ts +0 -1
  22. package/dist/standard/es/bindings/PolygonizerOptions.d.ts +1 -1
  23. package/dist/standard/es/bindings/SnapStrategy.d.ts +9 -19
  24. package/dist/standard/es/index.d.ts +0 -1
  25. package/dist/standard/es/index.js +2 -2
  26. package/dist/standard/es/index_slim.d.ts +0 -1
  27. package/dist/standard/es/index_threads.d.ts +0 -1
  28. package/dist/standard/pkg-wrapper/bindings/PolygonizerOptions.d.ts +1 -1
  29. package/dist/standard/pkg-wrapper/bindings/SnapStrategy.d.ts +9 -19
  30. package/dist/threads/es/bindings/PolygonizerOptions.d.ts +1 -1
  31. package/dist/threads/es/bindings/SnapStrategy.d.ts +9 -19
  32. package/dist/threads/es/index.d.ts +0 -1
  33. package/dist/threads/es/index_slim.d.ts +0 -1
  34. package/dist/threads/es/index_threads.d.ts +0 -1
  35. package/dist/threads/pkg-wrapper/bindings/PolygonizerOptions.d.ts +1 -1
  36. package/dist/threads/pkg-wrapper/bindings/SnapStrategy.d.ts +9 -19
  37. package/package.json +1 -1
  38. package/dist/slim/cjs/bindings/TilingOptions.d.ts +0 -6
  39. package/dist/slim/es/bindings/TilingOptions.d.ts +0 -6
  40. package/dist/slim/pkg-wrapper/bindings/TilingOptions.d.ts +0 -6
  41. package/dist/standard/cjs/bindings/TilingOptions.d.ts +0 -6
  42. package/dist/standard/es/bindings/TilingOptions.d.ts +0 -6
  43. package/dist/standard/pkg-wrapper/bindings/TilingOptions.d.ts +0 -6
  44. package/dist/threads/es/bindings/TilingOptions.d.ts +0 -6
  45. package/dist/threads/pkg-wrapper/bindings/TilingOptions.d.ts +0 -6
package/README.md CHANGED
@@ -145,6 +145,12 @@ The default return shape is a stable dictionary with `polygons` as
145
145
  `SimplePolygon` values. Use `return_polygons=True` only when you want Shapely
146
146
  `Polygon` objects.
147
147
 
148
+ `SnapStrategy::Grid` keeps topology and output coordinates on the configured
149
+ precision grid. The CFB profile uses `GeosCompat`: the grid establishes robust
150
+ topology, then output nodes regain deterministic source coordinates to better
151
+ match Shapely `snap` plus full-precision noding. It is not `set_precision`
152
+ emulation, and exact parity is not guaranteed for many-to-one snaps.
153
+
148
154
  For Shapely parity checks, compare report-mode outputs with the built-in
149
155
  mismatch helper:
150
156
 
Binary file
Binary file
@@ -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>;
@@ -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;
@@ -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>;
@@ -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;
@@ -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>;