Skip to content

Commit

Permalink
Allow csv unescaping for station names
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruechert committed Apr 29, 2024
1 parent 7f0c17b commit 818b8d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/loader/gtfs/stop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct stop {
}

std::string_view id_;
std::string_view name_;
std::string name_;
std::string_view platform_code_;
geo::latlng coord_;
std::string_view timezone_;
Expand Down Expand Up @@ -176,7 +176,7 @@ locations_map read_stops(source_idx_t const src,

struct csv_stop {
utl::csv_col<utl::cstr, UTL_NAME("stop_id")> id_;
utl::csv_col<utl::cstr, UTL_NAME("stop_name")> name_;
utl::csv_col<std::string, UTL_NAME("stop_name")> name_;
utl::csv_col<utl::cstr, UTL_NAME("stop_timezone")> timezone_;
utl::csv_col<utl::cstr, UTL_NAME("parent_station")> parent_station_;
utl::csv_col<utl::cstr, UTL_NAME("platform_code")> platform_code_;
Expand All @@ -197,7 +197,7 @@ locations_map read_stops(source_idx_t const src,
}).get();

new_stop->id_ = s.id_->view();
new_stop->name_ = s.name_->view();
new_stop->name_ = std::move(*s.name_);
new_stop->coord_ = {utl::parse<double>(s.lat_->trim()),
utl::parse<double>(s.lon_->trim())};
new_stop->platform_code_ = s.platform_code_->view();
Expand All @@ -213,7 +213,7 @@ locations_map read_stops(source_idx_t const src,
new_stop->parent_ = parent;
}

equal_names[s.name_->view()].emplace_back(new_stop);
equal_names[new_stop->name_].emplace_back(new_stop);
});

auto const stop_vec =
Expand Down

0 comments on commit 818b8d4

Please sign in to comment.