Coder Social home page Coder Social logo

mapsme / just_gtfs Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 17.0 137 KB

C++17 header-only library for reading and writing GTFS ๐ŸŒ

License: MIT License

CMake 0.83% C++ 99.17%
cpp17 gtfs gtfs-feed gtfs-static header-only public-transport tools transit

just_gtfs's People

Contributors

baqablh avatar bykoianko avatar github-actions[bot] avatar ldo2 avatar mesozoic-drones avatar tatiana-yan avatar vesavlad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

just_gtfs's Issues

add bitmask for CalendarItem for available weekdays

Not a biggie, but it'd make the API more useful IMHO, if we added a uint8_t bitmask for the CalendarItem telling us easily which days are valid. Currently it's "lots" of code to capture that downstream.

Wrong header written to shapes.txt

The header for shapes.txt is missing the shape_dist_traveled field, while the data actually writes it, resulting in a broken CSV.

inline void write_shapes_header(std::ofstream & out)
{
std::vector<std::string> fields = {"shape_id", "shape_pt_lat", "shape_pt_lon",
"shape_pt_sequence"};
write_joined(out, std::move(fields));
}

Parse error: "transfer_type" in transfers.txt can be empty

Hi,
Based on:
https://gtfs.org/reference/static/#transferstxt

Indicates the type of connection for the specified (from_stop_id, to_stop_id) pair. Valid options are:

0 or empty - Recommended transfer point between routes.
1 - Timed transfer point between two routes. The departing vehicle is expected to wait for the arriving one and leave sufficient time for a rider to transfer between routes.
2 - Transfer requires a minimum amount of time between arrival and departure to ensure a connection. The time required to transfer is specified by min_transfer_time.
3 - Transfers are not possible between routes at the location.

Therefore, the 'transfer_type' values can be empty, so:

inline Result Feed::add_transfer(const ParsedCsvRow & row)
{
  Transfer transfer;
  try
  {
    // Required fields:
    transfer.from_stop_id = row.at("from_stop_id");
    transfer.to_stop_id = row.at("to_stop_id");
    set_field(transfer.transfer_type, row, "transfer_type", false);

    // Optional:
    set_field(transfer.min_transfer_time, row, "min_transfer_time");
  }

should be changed to:
set_field(transfer.transfer_type, row, "transfer_type");

Campatiblity with c++ 14

Hi, I was working on a project which is not c++17 compatible, so I made a patch to made your library compatible with c++14 using boost,
Can you look into it?
Can you accept it as a separate branch for other people to use

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.