Skip to content

Commit

Permalink
load zonal odt data
Browse files Browse the repository at this point in the history
  • Loading branch information
azime committed Jan 15, 2025
1 parent 86b8946 commit 4be5300
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/ed/connectors/gtfs_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,10 @@ std::vector<nm::StopTime*> StopTimeGtfsHandler::handle_line(Data& data, const cs
stop_time->drop_off_allowed = (row[drop_off_c] != "1" && row[drop_off_c] != "3");
else
stop_time->drop_off_allowed = true;

if (row[arrival_c].empty() && row[departure_c].empty()) {
stop_time->pick_up_allowed = false;
stop_time->drop_off_allowed = false;
}
stop_time->vehicle_journey->stop_time_list.push_back(stop_time);
stop_time->wheelchair_boarding = stop_time->vehicle_journey->wheelchair_boarding;
stop_time->idx = data.stops.size();
Expand Down
35 changes: 35 additions & 0 deletions source/ed/tests/fusioparser_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,3 +785,38 @@ BOOST_AUTO_TEST_CASE(pathway_tests) {

test(*data.pathways[2], "SP:B:IO:1", "SP:B:IO:1", "SP:B", "IO:1", 3, true, 42, 60, 40, 30, 2, "", "");
}

BOOST_AUTO_TEST_CASE(ntfs_with_zonal_odt) {
ed::Data data;

ed::connectors::FusioParser parser(ntfs_path + "_with_zonal_odt");
parser.fill(data, "20240916");

BOOST_REQUIRE_EQUAL(data.lines.size(), 6);
BOOST_REQUIRE_EQUAL(data.vehicle_journeys.size(), 6);
BOOST_REQUIRE_EQUAL(data.routes.size(), 6);
BOOST_REQUIRE_EQUAL(data.stop_points.size(), 18);
BOOST_REQUIRE_EQUAL(data.stop_areas.size(), 18);

BOOST_CHECK_EQUAL(data.lines[0]->uri, "JeanJaures_GareMennecy");
BOOST_CHECK_EQUAL(data.lines[0]->name, "TAD");
BOOST_CHECK_EQUAL(data.lines[1]->uri, "GareMennecy_CorbeilEssonnes");
BOOST_CHECK_EQUAL(data.lines[1]->name, "D");
BOOST_CHECK_EQUAL(data.lines[2]->uri, "MoulinGalant_MoulinFoulon");
BOOST_CHECK_EQUAL(data.lines[2]->name, "TAD");
BOOST_CHECK_EQUAL(data.lines[3]->uri, "bus_aa");
BOOST_CHECK_EQUAL(data.lines[3]->name, "AA");
BOOST_CHECK_EQUAL(data.lines[4]->uri, "bus_bb");
BOOST_CHECK_EQUAL(data.lines[4]->name, "BB");
BOOST_CHECK_EQUAL(data.lines[5]->uri, "Juvisy:RisOrangis");
BOOST_CHECK_EQUAL(data.lines[5]->name, "Juvisy Ris Orangis");


BOOST_CHECK_EQUAL(data.vehicle_journeys[0]->uri, "SP:JeanJaures_SP:ODT:GareMennecy");
BOOST_CHECK_EQUAL(data.vehicle_journeys[0]->name, "Gare de mennecy");
BOOST_REQUIRE_EQUAL(data.vehicle_journeys[0]->stop_time_list.size(), 3);
for (auto st : data.vehicle_journeys[0]->stop_time_list) {
BOOST_CHECK_EQUAL(st->drop_off_allowed, false);
BOOST_CHECK_EQUAL(st->pick_up_allowed, false);
}
}

0 comments on commit 4be5300

Please sign in to comment.