6 个版本 (3 个重大更改)
| 0.5.0 | 2024 年 2 月 29 日 |
|---|---|
| 0.3.1 | 2022 年 11 月 9 日 |
| 0.3.0 | 2021 年 7 月 29 日 |
| 0.2.0 | 2021 年 7 月 27 日 |
| 0.1.1 | 2020 年 5 月 27 日 |
#237 在 数据结构
83 每月下载次数
20KB
263 代码行
GTFS 到 GeoJson
这个 Rust 包用于将 GTFS 数据转换为 GeoJSON 格式。
安装包
虽然存储库命名为 gtfs-to-geojson,但包名为 gtfs_geojson,可以使用以下命令安装:
cargo add gtfs_geojson
函数
gtfs_geojson 库使用 gtfs_structures 库及其类型将 gtfs 文件转换为 geojson。
extract_stops(>fs: >fs_structures::Gtfs) -> Vec
extract_stops 将从 gtfs 中导出所有站点及其属性。
extract_trips_shapes(>fs: >fs_structures::Gtfs) -> Vec
extract_trips_shapes 将从 shapes.txt 文件中导出所有形状作为线要素,并在 geojson 属性中添加 trips.txt 中每个要素的行程信息。
如何编译和运行独立程序
- 克隆此存储库
- 安装 Rust
- 使用
cargo test --all-features运行测试(请参阅 GitHub 操作设置) - 使用
cargo build --release构建优化后的二进制文件 - 使用
cargo run --release -- --help运行独立程序 - 要在没有 cargo 的情况下运行独立程序(例如,当分发二进制文件时),请运行
target/release/gtfs-geojson --help
依赖关系
~12MB
~205K SLoC