transit_model
is a Rust crate managing transit data by implementing the NTFS
model (used in navitia). See the
section NTFS: Level of Support for more details about the
level of support of the NTFS standard.
This repository also provides :
- (incomplete) GTFS to NTFS and (soon) NTFS to GTFS conversion.
- (incomplete) Generation of transfers. .
- Merge [NTFS] (https://github.com/CanalTP/ntfs-specification/blob/master/ntfs_fr.md).
cargo build --release
Some formats needs an additional dependency called PROJ
which allows the transformation of localization coordinates.
crates.io provides a
proj
crate which is a binding to the C
library (version 6.3.0). This means you need PROJ version
6.3.0 installed on your system. See PROJ installation
instructions.
PROJ is configured as a feature
of the transit_model
crate. Once PROJ is installed on your machine, you need a
few more dependencies for building transit_model
.
apt install -y clang libssl-dev
cargo build --features=proj
Now, you should be able to use a full-fledge transit_model
. Enjoy!
If you want to use PROJ in your code, you can if you
activate the proj
feature (cargo build --features=proj
). Then don't forget
to protect your code with #[cfg(feature="proj")]
.
transit_model
is capable of exporting NeTEx France format. In the tests, we're
automatically verifying that the produced files are matching the NeTEx
specification. For that, we're using the tool xmllint
which can be install
on Debian with the package libxml2-utils
. Therefore, these tests are run only
if you activate them. We also depend on NeTEx specification that are imported as
a git submodule.
git submodule update --init --recursive
apt install libxml2-utils
cargo test --features xmllint
NTFS needs a Dataset
and a Contributor
.
Default ones are provided by the command but you can pass a json file that contains some information for creating a Dataset
and a Contributor
as explained in the documentation.
{
"contributor": {
"contributor_id" : "your_contributor_id",
"contributor_name" : "your_contributor_name",
"contributor_license" : "your_contributor_license",
"contributor_website" : "your_contributor_website"
},
"dataset": {
"dataset_id" : "your_dataset_id",
"dataset_desc" : "optional_dataset_desc",
"dataset_system" : "optional_dataset_system"
}
}
cargo test
transit_model
is partially supporting v0.11.2
of NTFS (see CHANGELOG in
French).
From the standard, some of the functionalities are not fully supported:
- No support for Line Groups (files
line_groups.txt
andline_group_links.txt
) - The field
trip_short_name_at_stop
instop_times.txt
introduced in versionv0.10.0
is not supported
Licensed under GNU Affero General Public License v3.0