Skip to content

Commit

Permalink
Rev to 0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBossbaly committed Jun 6, 2023
1 parent 8568fe2 commit 4d0b9d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "septa-api"
version = "0.3.1"
version = "0.3.2"
edition = "2021"
description = "SEPTA Async Rust API Client"
keywords = ["septa", "api", "public-transit", "regional-rail", "train"]
Expand Down
15 changes: 14 additions & 1 deletion examples/geojson_example.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use geojson::{feature, Feature, FeatureCollection, Geometry, Value};
use septa_api::Client;
use septa_api::{types::RegionalRailStop, Client};
use std::{env, fs::File, io::Write};
use strum::IntoEnumIterator;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand All @@ -21,6 +22,18 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});
}

for station in RegionalRailStop::iter().filter(|p| !matches!(p, RegionalRailStop::Unknown(_))) {
let lat_lon = station.lat_lon()?;

features.push(Feature {
bbox: None,
geometry: Some(Geometry::new(Value::Point(vec![lat_lon.1, lat_lon.0]))),
id: Some(feature::Id::String(station.to_string())),
properties: None,
foreign_members: None,
})
}

let gtfs_rails = gtfs_structures::Gtfs::new(
format!(
"{}/tests/gtfs_data/septa_rail.zip",
Expand Down

0 comments on commit 4d0b9d8

Please sign in to comment.