geo-polygonize 0.43.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,27 +24,37 @@ For an ambitious, prioritized plan covering performance, security, API consisten
24
24
  ### Library
25
25
 
26
26
  ```rust
27
- use geo_polygonize_core::{polygonize, Coord3D, Line3D};
28
- use geo_polygonize_core::options::PolygonizerOptions;
27
+ use geo_polygonize_core::{polygonize_line_strings, PolygonizerOptions};
28
+ use geo_types::LineString;
29
29
 
30
30
  fn main() {
31
- let points = [
32
- Coord3D::new(0.0, 0.0, 0.0),
33
- Coord3D::new(10.0, 0.0, 0.0),
34
- Coord3D::new(10.0, 10.0, 0.0),
35
- Coord3D::new(0.0, 10.0, 0.0),
36
- ];
37
- let lines = (0..4).map(|i| Line3D::new(points[i], points[(i + 1) % 4], i as u32));
38
-
39
- let result = polygonize(lines, &PolygonizerOptions::default())
31
+ let ring = LineString::from(vec![
32
+ (0.0, 0.0),
33
+ (10.0, 0.0),
34
+ (10.0, 10.0),
35
+ (0.0, 10.0),
36
+ (0.0, 0.0),
37
+ ]);
38
+
39
+ let result = polygonize_line_strings([&ring], &PolygonizerOptions::default())
40
40
  .expect("Polygonization failed");
41
+ let polygons = result.into_multi_polygon();
41
42
 
42
- for polygon in result.polygons {
43
- println!("Found polygon with area: {}", polygon.unsigned_area_2d());
43
+ for polygon in polygons {
44
+ println!("Found polygon: {polygon:?}");
44
45
  }
45
46
  }
46
47
  ```
47
48
 
49
+ `polygonize_line_strings` accepts owned or borrowed `geo_traits::LineStringTrait`
50
+ values. Use `polygonize` when source IDs or Z values must be supplied explicitly,
51
+ and keep its full result when dangles, cut edges, invalid rings, or diagnostics are
52
+ needed.
53
+
54
+ Rust consumers should import the supported facade from the crate root. Graph,
55
+ noding, containment, utility, mutable-builder, and tiled APIs are internal or
56
+ experimental and may change without compatibility guarantees before `1.0`.
57
+
48
58
  ### Choosing noding and precision
49
59
 
50
60
  Polygonization quality is heavily influenced by input noding strategy.
Binary file
Binary file