Skip to content

Commit

Permalink
Move osm-reader to its own crate
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Dec 8, 2023
1 parent ec02044 commit 3b88d29
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 273 deletions.
13 changes: 11 additions & 2 deletions backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ edition = "2021"
crate-type = ["cdylib", "rlib"]

[dependencies]
anyhow = "1.0.75"
console_error_panic_hook = "0.1.6"
console_log = "1.0.0"
fast_paths = { git = "https://github.com/easbar/fast_paths" }
geo = "0.27.0"
geojson = { git = "https://github.com/georust/geojson", features = ["geo-types"] }
log = "0.4.20"
roxmltree = { version = "0.19.0", default-features = false }
osm-reader = { git = "https://github.com/a-b-street/osm-reader" }
rand = { version = "0.8.5", default-features = false }
rand_xorshift = "0.3.0"
rstar = { version = "0.11.0" }
serde = "1.0.188"
serde_json = "1.0.105"
serde-wasm-bindgen = "0.6.0"
wasm-bindgen = "0.2.87"
web-sys = { version = "0.3.64", features = ["console"] }
anyhow = "1.0.75"
osmpbf = "0.3.2"
rstar = { version = "0.11.0" }
fast_paths = { git = "https://github.com/easbar/fast_paths" }
rand = { version = "0.8.5", default-features = false }
rand_xorshift = "0.3.0"
1 change: 0 additions & 1 deletion backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use wasm_bindgen::prelude::*;

mod heatmap;
mod node_map;
mod osm_reader;
mod route;
mod scrape;
mod tags;
Expand Down
100 changes: 0 additions & 100 deletions backend/src/osm_reader/mod.rs

This file was deleted.

74 changes: 0 additions & 74 deletions backend/src/osm_reader/pbf.rs

This file was deleted.

87 changes: 0 additions & 87 deletions backend/src/osm_reader/xml.rs

This file was deleted.

4 changes: 2 additions & 2 deletions backend/src/scrape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::collections::HashMap;

use anyhow::Result;
use geo::{Coord, LineString, Point};
use osm_reader::{Element, NodeID, WayID};

use crate::osm_reader::{Element, NodeID, WayID};
use crate::tags::Tags;
use crate::{Intersection, IntersectionID, MapModel, Road, RoadID, RoadKind};

Expand All @@ -16,7 +16,7 @@ struct Way {
pub fn scrape_osm(input_bytes: &[u8]) -> Result<MapModel> {
let mut node_mapping = HashMap::new();
let mut highways = Vec::new();
for elem in crate::osm_reader::parse(input_bytes)? {
for elem in osm_reader::parse(input_bytes)? {
match elem {
Element::Node { id, lon, lat, .. } => {
let pt = Coord { x: lon, y: lat };
Expand Down

0 comments on commit 3b88d29

Please sign in to comment.