Handle some changes to the elevation_lookups importing. #82

This commit is contained in:
Dustin Carlino 2021-03-27 11:45:55 -07:00
parent 3f1abda5e2
commit e3adb4702f

View File

@ -43,10 +43,13 @@ pub fn add_data(map: &mut RawMap, timer: &mut Timer) -> Result<()> {
))
.arg("-t")
// TODO Upload this to Docker Hub, so it's easier to distribute
.arg("elevation_lookups_lidar")
.arg("elevation_lookups_srtm")
.arg("python3")
.arg("main.py")
.arg("query"),
.arg("query")
// TODO How to tune this? Pretty machine dependant, and using ALL available cores may
// melt memory.
.arg("--n_threads=1"),
);
timer.stop("run elevation_lookups");
@ -108,12 +111,20 @@ fn scrape_output(map: &mut RawMap, ids: Vec<OriginalRoad>) -> Result<()> {
let line = line?;
let mut values = Vec::new();
for x in line.split('\t') {
let x = x.parse::<f64>()?;
if !x.is_finite() {
// TODO Warn
if let Ok(x) = x.parse::<f64>() {
if !x.is_finite() {
// TODO Warn
continue;
}
if x < 0.0 {
// TODO Temporary
continue;
}
values.push(Distance::meters(x));
} else {
// Blank lines mean the tool failed to figure out what happened
continue;
}
values.push(Distance::meters(x));
}
if values.len() != 4 {
error!("Elevation output line \"{}\" doesn't have 4 numbers", line);