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

Function parse_coord

nodedb-spatial/src/wkt.rs:124–130  ·  view source on GitHub ↗

Parse "lng lat" pair.

(s: &str)

Source from the content-addressed store, hash-verified

122
123/// Parse "lng lat" pair.
124fn parse_coord(s: &str) -> Option<[f64; 2]> {
125 let s = s.trim();
126 let mut parts = s.split_whitespace();
127 let lng: f64 = parts.next()?.parse().ok()?;
128 let lat: f64 = parts.next()?.parse().ok()?;
129 Some([lng, lat])
130}
131
132/// Parse "lng1 lat1, lng2 lat2, ..." into coordinate vec.
133fn parse_coord_list(s: &str) -> Option<Vec<[f64; 2]>> {

Callers 2

parse_pointFunction · 0.85
parse_multipointFunction · 0.85

Calls 3

okMethod · 0.45
parseMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected