1: Builds optimizer inputs - #4
Open
swastisingh2 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This files is to combine block groups, GTFS data, and cleaned services and convert them into structured accessibility inputs for the optimization model.
Tool 2 combines the block groups, the GTFS feed, and the cleaned services to produce the inputs needed for optimization. Block groups are loaded and reduced to representative points. The GTFS tables are read and used to reconstruct the mapping between routes and the stops they serve. Using the spatial layout of stops, the script identifies clusters of stops that are close enough to function as transfer points, and any routes associated with those stops are treated as neighbors.
The walking relationships are then computed. Each block is checked against nearby stops to determine which routes are walkable, and the minimum distance to those routes is recorded. These results form W.csv. Services are linked to the network by finding the stops within range of each service location and assigning the routes that serve those stops. Starting from the routes walkable from a block, the script expands through the neighbor graph to capture routes reachable within a small number of transfers. A service is considered reachable from a block when any of its associated routes appears in that expanded set. These relationships form T.csv, and the neighbor list is written out as well. Although the current inputs come from Milwaukee and Racine, the workflow applies to any GTFS dataset.