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

Function parse_polygon

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

Source from the content-addressed store, hash-verified

149}
150
151fn parse_polygon(s: &str) -> Option<Geometry> {
152 let inner = strip_parens(s)?;
153 let rings = split_top_level_parens(inner)?;
154 let ring_coords: Option<Vec<Vec<[f64; 2]>>> = rings
155 .iter()
156 .map(|r| parse_coord_list(strip_parens(r.trim())?))
157 .collect();
158 Some(Geometry::Polygon {
159 coordinates: ring_coords?,
160 })
161}
162
163fn parse_multipoint(s: &str) -> Option<Geometry> {
164 let inner = strip_parens(s)?;

Callers 1

geometry_from_wktFunction · 0.85

Calls 5

strip_parensFunction · 0.85
split_top_level_parensFunction · 0.85
parse_coord_listFunction · 0.85
collectMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected