Closed ArezHK closed 7 months ago
There's currently no way to spatially filter a GTFS feed in pt2matsim. I'd suggest filtering a feed with other tools and then use the extract as input to pt2matsim. Maybe the resources and libraries here are helpful: https://github.com/MobilityData/awesome-transit?tab=readme-ov-file#gtfs
I can just provide a quick way in R as an example:
library(tidytransit)
gtfs = read_gtfs("gtfs_file.zip")
gtfs_extract = filter_feed_by_area(gtfs, c(lon_min, lat_min, lon_max, lat_max))
write_gtfs(gtfs_extract, "output_file.zip")
Dear @polettif , thank you for your assistance and for sharing the R code.
Hello,
I am attempting to create a multimodal network for my designated area using pt2matsim. While I have successfully constructed the network, I encountered a challenge. Due to the presence of multiple transport companies in my target area and the absence of specific GTFS data for my city, I opted to use a GTFS file for the entire province, Baden-Württemberg, where my city is located. However, the resulting network and schedule files are so large and heavy that my PC struggles to handle the simulation.
Is there a method to extract transit data and map it only for a specific area, perhaps using a shapefile or by filtering GTFS data based on the names of active transportation companies in that region? This way, I could generate a lighter schedule file and network.
Thank you in advance for your assistance.