Skip to content

Commit

Permalink
Stop storing OSM tags on roads. They have no purpose, and the perf
Browse files Browse the repository at this point in the history
impact is substantial (470MB to 360MB for a large import file size)
  • Loading branch information
dabreegster committed May 24, 2024
1 parent 4679570 commit ac733d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions backend/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use geo::{LineString, Point, Polygon};
use geojson::{Feature, GeoJson, Geometry};
use rstar::{primitives::GeomWithData, RTree};
use serde::{Deserialize, Serialize};
use utils::{Mercator, Tags};
use utils::Mercator;

use crate::amenity::Amenity;
use crate::gtfs::{GtfsModel, StopID};
Expand Down Expand Up @@ -61,7 +61,6 @@ pub struct Road {
// For performance
pub length_meters: f64,
pub linestring: LineString,
pub tags: Tags,

// A simplified view of who can access a road. All might be None (buses, trains ignored)
pub access: EnumMap<Mode, Direction>,
Expand Down Expand Up @@ -151,9 +150,6 @@ impl Road {
f.set_property("way", self.way.to_string());
f.set_property("node1", self.node1.to_string());
f.set_property("node2", self.node2.to_string());
for (k, v) in &self.tags.0 {
f.set_property(k, v.to_string());
}
f.set_property("access_car", format!("{:?}", self.access[Mode::Car]));
f.set_property(
"access_bicycle",
Expand Down
1 change: 0 additions & 1 deletion backend/src/scrape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ impl Graph {

access,
max_speed,
tags: e.osm_tags,
amenities: EnumMap::default(),
stops: Vec::new(),
}
Expand Down

0 comments on commit ac733d6

Please sign in to comment.