infer_depot_trip_endpoints() in depot_deadhead.py currently matches the start and end location of each point to the nearest point in the Transit_Depot shapefile. However, there are a couple of issues with the existing approach:
- The shapefile includes facility types other than depots, e.g., transit agency headquarters. We should only be using actual depot locations.
- The existing code doesn't filter by agency, so we might be assigning buses to a depot that belongs to another agency.
@YiZoeHe please update the code to filter based on agency and facility type. It looks like this dataset came from the NTD at https://data.transportation.gov/stories/s/gd62-jzra, so you can use the data description there to determine which facility types should be treated as depots, and how to connect the NTD IDs reported in the shapefile with agency names/IDs from GTFS.
infer_depot_trip_endpoints()indepot_deadhead.pycurrently matches the start and end location of each point to the nearest point in theTransit_Depotshapefile. However, there are a couple of issues with the existing approach:@YiZoeHe please update the code to filter based on agency and facility type. It looks like this dataset came from the NTD at https://data.transportation.gov/stories/s/gd62-jzra, so you can use the data description there to determine which facility types should be treated as depots, and how to connect the NTD IDs reported in the shapefile with agency names/IDs from GTFS.