mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 15:33:44 +03:00
Allow and ignore a 3rd coordinate in KML files
This commit is contained in:
parent
d445ca386a
commit
1510ff21c8
@ -124,7 +124,9 @@ fn recurse(
|
||||
|
||||
fn parse_pt(input: &str) -> Option<LonLat> {
|
||||
let coords: Vec<&str> = input.split(',').collect();
|
||||
if coords.len() != 2 {
|
||||
// Normally each coordinate is just (X, Y), but for census tract files, there's a third Z
|
||||
// component that's always 0. Just ignore it.
|
||||
if coords.len() < 2 {
|
||||
return None;
|
||||
}
|
||||
match (coords[0].parse::<f64>(), coords[1].parse::<f64>()) {
|
||||
|
Loading…
Reference in New Issue
Block a user