MCPcopy Create free account
hub / github.com/Notgnoshi/generative / node

Function node

generative/cxxbridge/noder.hpp:17–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#include <memory>
16
17[[nodiscard]] inline std::unique_ptr<GeometryGraphShim>
18node(const GeometryCollectionShim& rust_geoms, double tolerance) noexcept
19{
20 const auto geos_geoms = copy_rust_collection_to_geos(rust_geoms);
21 auto noded = std::unique_ptr<geos::geom::Geometry>(nullptr);
22 if (tolerance == 0.0)
23 {
24 noded = generative::noding::GeometryNoder::node(*geos_geoms, nullptr);
25 } else
26 {
27 auto noder = std::make_unique<geos::noding::snap::SnappingNoder>(tolerance);
28 noded = generative::noding::GeometryNoder::node(*geos_geoms, std::move(noder));
29 }
30 if (!noded)
31 {
32 return nullptr;
33 }
34
35 auto graph = generative::noding::GeometryGraph(*noded);
36
37 auto graph_shim = std::make_unique<GeometryGraphShim>(std::move(graph));
38
39 return graph_shim;
40}
41
42[[nodiscard]] inline PolygonizationResult polygonize(const GeometryGraphShim& graph) noexcept
43{

Callers 3

test_noder_doesnt_crashFunction · 0.70
test_noder_linestringFunction · 0.70

Calls 2

GeometryGraphClass · 0.85

Tested by 3

test_noder_doesnt_crashFunction · 0.56
test_noder_linestringFunction · 0.56