gistools/readers/gtfs/schedule/
location_groups.rs1use crate::readers::csv::parse_csv_as_record;
2use alloc::{collections::BTreeMap, string::String};
3use s2json::MValueCompatible;
4
5#[derive(Debug, Default, Clone, PartialEq, MValueCompatible)]
14pub struct GTFSLocationGroup {
15 pub location_group_id: String,
18 pub location_group_name: Option<String>,
21}
22impl GTFSLocationGroup {
23 pub fn new(source: &str) -> BTreeMap<String, GTFSLocationGroup> {
25 let mut res = BTreeMap::new();
26 for record in parse_csv_as_record::<GTFSLocationGroup>(source, None, None) {
27 res.insert(record.location_group_id.clone(), record);
28 }
29 res
30 }
31}