Skip to content

Commit

Permalink
Bring in a few more things
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Dec 2, 2023
1 parent b1d8052 commit 3023d39
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ extern crate log;
use std::collections::HashMap;
use std::sync::Once;

use serde::Deserialize;
use geo::{LineString, Point, Polygon};
use geojson::{Feature, Geometry, GeoJson};
use geojson::{Feature, GeoJson, Geometry};
use serde::Deserialize;
use wasm_bindgen::prelude::*;

mod osm;
Expand Down
6 changes: 5 additions & 1 deletion backend/src/scrape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ pub fn scrape_osm(input_bytes: &[u8]) -> Result<MapModel> {
node_mapping.insert(id, pt);
}
Element::Way { id, node_ids, tags } => {
if is_any(&tags, "highway", vec!["footway"]) {
if is_any(&tags, "highway", vec!["footway", "pedestrian"]) {
highways.push(Way { id, node_ids, tags });
} else if tags.contains_key("highway")
&& is_any(&tags, "sidewalk", vec!["both", "right", "left"])
{
highways.push(Way { id, node_ids, tags });
}
}
Expand Down
9 changes: 6 additions & 3 deletions web/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,17 @@
"crossing" in props
) {
props.color = "green";
} else {
} else if (props.highway == "footway") {
// TODO The categories aren't mutex, some could combo
if (props.indoor) {
props.color = "blue";
} else if (props.layer || props.bridge) {
} else if (props.layer || props.bridge || props.tunnel) {
props.color = "purple";
} else {
f.properties.color = "red";
props.color = "red";
}
} else {
props.color = "black";
}
}
return gj;
Expand All @@ -84,6 +86,7 @@
["Footway (ground, outdoors)", "red"],
["Indoors footway", "blue"],
["Footway not on the ground", "purple"],
["Street with sidewalk (or pedestrian street)", "black"],
["Crossing", "green"],
]}
/>
Expand Down

0 comments on commit 3023d39

Please sign in to comment.