MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_geometry_collection

Function parse_geometry_collection

nodedb-spatial/src/wkt.rs:211–217  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

209}
210
211fn parse_geometry_collection(s: &str) -> Option<Geometry> {
212 let inner = strip_parens(s)?;
213 // Split by top-level commas (not inside parentheses).
214 let parts = split_top_level_items(inner);
215 let geoms: Option<Vec<Geometry>> = parts.iter().map(|p| geometry_from_wkt(p.trim())).collect();
216 Some(Geometry::GeometryCollection { geometries: geoms? })
217}
218
219/// Split by commas at the top level of parentheses nesting.
220/// "(...), (...)" → ["(...)", "(...)"]

Callers 1

geometry_from_wktFunction · 0.85

Calls 5

strip_parensFunction · 0.85
split_top_level_itemsFunction · 0.85
geometry_from_wktFunction · 0.85
collectMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected