From 547171d5df7a340a3b3bb0dcd18004df20a1d670 Mon Sep 17 00:00:00 2001 From: ArnaudOggy Date: Mon, 30 Aug 2021 17:40:27 +0200 Subject: [PATCH] [fix] Add missing stop_code for stoplocation --- Cargo.toml | 2 +- ntfs2gtfs/tests/fixtures/input/stops.txt | 15 ++++++++------- ntfs2gtfs/tests/fixtures/output/stops.txt | 3 ++- src/gtfs/write.rs | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cef5c2dd8..9198e8df9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Kisio Digital ", "Guillaume Pinot "] name = "transit_model" -version = "0.41.0" +version = "0.41.1" license = "AGPL-3.0-only" description = "Transit data management" repository = "https://github.com/CanalTP/transit_model" diff --git a/ntfs2gtfs/tests/fixtures/input/stops.txt b/ntfs2gtfs/tests/fixtures/input/stops.txt index 4315430eb..476f3db25 100644 --- a/ntfs2gtfs/tests/fixtures/input/stops.txt +++ b/ntfs2gtfs/tests/fixtures/input/stops.txt @@ -1,7 +1,8 @@ -stop_id,stop_name,stop_lat,stop_lon,location_type,parent_station,equipment_id -stop:area:1,whatever,48.8,2.3,1,, -stop:area:2,whatever,48.8,2.3,1,, -stop:point:1,whatever,48.8,2.3,0,stop:area:1, -stop:point:2,whatever,48.8,2.3,0,stop:area:1, -stop:zone:1,whatever,48.8,2.3,2,stop:area:2, -stop:zone:2,whatever,48.8,2.3,2,stop:area:2, \ No newline at end of file +stop_id,stop_name,stop_lat,stop_lon,location_type,parent_station,equipment_id,stop_code +stop:area:1,whatever,48.8,2.3,1,,, +stop:area:2,whatever,48.8,2.3,1,,, +stop:point:1,whatever,48.8,2.3,0,stop:area:1,,point1 +stop:point:2,whatever,48.8,2.3,0,stop:area:1,, +stop:zone:1,whatever,48.8,2.3,2,stop:area:2,, +stop:zone:2,whatever,48.8,2.3,2,stop:area:2,, +stop:entrance:1,whatever,48.8,2.3,3,stop:area:1,,entrance1 diff --git a/ntfs2gtfs/tests/fixtures/output/stops.txt b/ntfs2gtfs/tests/fixtures/output/stops.txt index 23981fc9c..76114c661 100644 --- a/ntfs2gtfs/tests/fixtures/output/stops.txt +++ b/ntfs2gtfs/tests/fixtures/output/stops.txt @@ -1,4 +1,5 @@ stop_id,stop_code,stop_name,stop_desc,stop_lon,stop_lat,zone_id,stop_url,location_type,parent_station,stop_timezone,level_id,wheelchair_boarding,platform_code -stop:point:1,,whatever,,2.3,48.8,,,0,stop:area:1,,,0, +stop:point:1,point1,whatever,,2.3,48.8,,,0,stop:area:1,,,0, stop:point:2,,whatever,,2.3,48.8,,,0,stop:area:1,,,0, stop:area:1,,whatever,,2.3,48.8,,,1,,,,0, +stop:entrance:1,entrance1,whatever,,2.3,48.8,,,2,stop:area:1,,,0, diff --git a/src/gtfs/write.rs b/src/gtfs/write.rs index 3aa84d737..f2ede9bfc 100644 --- a/src/gtfs/write.rs +++ b/src/gtfs/write.rs @@ -162,7 +162,7 @@ fn ntfs_stop_location_to_gtfs_stop( fare_zone_id: None, location_type: StopLocationType::from(sl.stop_type.clone()), parent_station: sl.parent_id.clone(), - code: None, + code: sl.code.clone(), desc: get_first_comment_name(sl, comments), wheelchair_boarding: wheelchair, url: None,