Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Transforms a GTFS file towards a directed acyclic graph of "connections".
A connection is the combination of a departure and its successive arrival of the same trip. Our goal is to retrieve a list of connections that is sorted by departure time, better known as a Directed Acyclic Graph. This way, routeplanning algorithms can be performed.
npm install -g gtfs2lc
First, unzip your GTFS file to a place on your disk using e.g., unzip gtfs.zip -d /tmp
Now, we need to make sure that a couple of files are ordered in a specific fashion, not required by the GTFS spec:
trip_id
and stop_sequence
. Mind that the number of the columns are also not standardized by GTFS and you might need to tweak the sort command in this repo.service_id
.service_id
.We've enclosed a bash script which ensures this for you. It isn't perfect however and may not return the desired result. You can run this bash script using gtfs2lc-sort $pathname
.
If you've ensured this, you can use this tool on the command line as follows:
gtfs2lc /path/to/extracted/gtfs -f csv --startDate 20151101 -e 20160101
You also can load the data into mongodb in extended json-ld format as follows:
gtfs2lc /path/to/extracted/gtfs -f mongold -b baseUris.json | mongoimport -c myconnections
Mind that only MongoDB starting version 2.6 is supported.
For more options, check gtfs2lc --help
We convert stop_times.txt
to a stream of connection rules. These rules need a certain explanation about on which days they are running, which can be retrieved using the trip_id
in the connection rules stream.
At the same time, we process calendar_dates.txt
and calendar.txt
towards a binary format. It will contain a 1 for the number of days from a start date for which the service id is true.
In the final step, the connection rules are expanded towards connections by joining the days, service ids and rules.
At this moment we've only implemented a conversion from the Stop Times to connections. However, in future work we will also implement a system for describing trips and routes, a system for transit stops and a system for transfers.
Furthermore, also frequencies.txt
is not supported at this time. We hope to support this in the future though.
Pieter Colpaert - pieter.colpaert@ugent.be
FAQs
Mapping script from gtfs to (linked) connections
The npm package gtfs2lc receives a total of 3 weekly downloads. As such, gtfs2lc popularity was classified as not popular.
We found that gtfs2lc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.