stop warning for roads without names if they use 'noname=yes'. related

to #147
This commit is contained in:
Dustin Carlino 2020-07-13 10:40:45 -07:00
parent c2bd5fcf6f
commit 85b45caf1a
2 changed files with 21 additions and 8 deletions

View File

@ -492,14 +492,15 @@ fn get_multipolygon_members(
pts_per_way.push((*id, pts.to_vec()));
} else {
println!(
"Relation {} has unhandled member role {}, ignoring it",
rel.id, role
"{} has unhandled member role {}, ignoring it",
rel_url(rel.id),
role
);
}
}
}
_ => {
println!("Relation {} refers to {:?}", rel.id, member);
println!("{} refers to {:?}", rel_url(rel.id), member);
ok = false;
}
}

View File

@ -195,10 +195,19 @@ impl Map {
});
}
if road.get_name() == "???" {
timer.warn(format!(
"{} has no name. Tags: {:?}",
road.id, road.osm_tags
));
// Suppress the warning in some cases.
if !(road.osm_tags.get("noname") == Some(&"yes".to_string())
|| road
.osm_tags
.get(osm::HIGHWAY)
.map(|x| x.ends_with("_link"))
.unwrap_or(false))
{
timer.warn(format!(
"{} has no name. Tags: {:?}",
road.orig_id, road.osm_tags
));
}
}
map.roads.push(road);
}
@ -331,7 +340,10 @@ impl Map {
r.id = BusRouteID(map.bus_routes.len());
map.bus_routes.push(r);
} else {
timer.warn(format!("Skipping route {}", r.name));
timer.warn(format!(
"Skipping route {} due to connectivity problems",
r.name
));
}
}