fasttrips.TAZ¶
-
class
fasttrips.TAZ(output_dir, gtfs, today, stops, transfers, routes)[source]¶ Bases:
objectTAZ class.
One instance represents all of the Transportation Analysis Zones as well as their access links and egress links.
Todo
This is really about the access and egress links; perhaps it should be renamed?
Stores access link information in
TAZ.walk_access, andTAZ.drive_access, both instances ofpandas.DataFrame.-
__init__(output_dir, gtfs, today, stops, transfers, routes)[source]¶ Constructor. Reads the TAZ data from the input files in input_archive.
Methods
__init__(output_dir, gtfs, today, stops, …)Constructor. add_distance(links_df, dist_col)Sets distance column value for access and egress links. warn_on_stops_without_walk_access(stops)Do any stops lack any walk access? write_access_egress_for_extension(output_dir)Write the access and egress links to a single output file for the C++ extension to read. Attributes
ACCESS_EGRESS_MODESaccess and egress modes. ACCESS_MODE_NUMSAccess mode number list, in order of ACCESS_EGRESS_MODES BIKE_MODE_NUMSBike mode number list DAP_COLUMN_CAPACITYfasttrips DAP column name: Capacity (number of parking spaces) DAP_COLUMN_DROP_OFFfasttrips DAP column name: Drop-Off. DAP_COLUMN_HOURLY_COSTfasttrips DAP column name: Hourly Cost in cents. DAP_COLUMN_LOT_IDfasttrips DAP column name: Lot ID. DAP_COLUMN_LOT_LATITUDEfasttrips DAP column name: Lot Latitude (WGS 84) DAP_COLUMN_LOT_LONGITUDEfasttrips DAP column name: Lot Longitude (WGS 84) DAP_COLUMN_MAXIMUM_COSTfasttrips DAP column name: Maximum Daily Cost in cents. DAP_COLUMN_NAMEfasttrips DAP column name: Name of the Lot. DAP_COLUMN_TYPEfasttrips DAP column name: Type DRIVE_ACCESS_COLUMN_AUTO_CAPACITYfasttrips Drive access links column name: Auto Capacity, vehicles per hour per mile. DRIVE_ACCESS_COLUMN_COSTDrive access links column name: Drive cost in cents (integer) DRIVE_ACCESS_COLUMN_DIRECTIONDrive access links column name: Direction (‘access’ or ‘egress’) DRIVE_ACCESS_COLUMN_DISTANCEDrive access links column name: Drive distance DRIVE_ACCESS_COLUMN_DRIVE_DISTANCEfasttrips These are the original attributes but renamed to be clear they are the drive component (as opposed to the walk) DRIVE_ACCESS_COLUMN_DRIVE_TRAVEL_TIMEDRIVE_ACCESS_COLUMN_DRIVE_TRAVEL_TIME_MINDrive access links column name: Driving time in minutes between TAZ and lot (float) DRIVE_ACCESS_COLUMN_ELEVATION_GAINfasttrips Drive access links column name: Elevation Gain, feet gained along link. DRIVE_ACCESS_COLUMN_END_TIMEDrive access links column name: End time (e.g. DRIVE_ACCESS_COLUMN_END_TIME_MINDrive access links column name: End time (e.g. DRIVE_ACCESS_COLUMN_INDIRECTNESSfasttrips Drive access links column name: Indirectness, ratio of Manhattan distance to crow-fly distance. DRIVE_ACCESS_COLUMN_LOT_IDDrive access links column name: Stop Identifier. DRIVE_ACCESS_COLUMN_POPULATION_DENSITYfasttrips Drive access links column name: Population Density, people per square mile. DRIVE_ACCESS_COLUMN_RETAIL_DENSITYfasttrips Drive access links column name: Retail Density, employees per square mile. DRIVE_ACCESS_COLUMN_START_TIMEDrive access links column name: Start time (e.g. DRIVE_ACCESS_COLUMN_START_TIME_MINDrive access links column name: Start time (e.g. DRIVE_ACCESS_COLUMN_STOPfasttrips Drive access links column name: Stop Numerical Identifier. DRIVE_ACCESS_COLUMN_STOP_NUMfasttrips Drive access links column name: Stop Numerical Identifier. DRIVE_ACCESS_COLUMN_SUPPLY_MODEfasttrips Drive access links column name: Supply mode. DRIVE_ACCESS_COLUMN_SUPPLY_MODE_NUMDrive access links column name: Supply mode number. DRIVE_ACCESS_COLUMN_TAZDrive access links column name: TAZ Identifier. DRIVE_ACCESS_COLUMN_TAZ_NUMfasttrips Drive access links column name: TAZ Numerical Identifier. DRIVE_ACCESS_COLUMN_TRAVEL_TIMEDrive access links column name: Driving time in minutes between TAZ and lot (TimeDelta) DRIVE_ACCESS_COLUMN_WALK_DISTANCEfasttrips Drive access links column name: Walk distance from lot to transit. DRIVE_ACCESS_COLUMN_WALK_TIMEfasttrips Drive access links column name: Walk time from lot to transit. DRIVE_ACCESS_COLUMN_WALK_TIME_MINfasttrips Drive access links column name: Walk time from lot to transit. DRIVE_MODE_NUMSDrive mode number list EGRESS_MODE_NUMSEgress mode number list, in order of ACCESS_EGRESS_MODES INPUT_DAP_FILEFile with fasttrips drive access points information. INPUT_DRIVE_ACCESS_FILEFile with fasttrips drive access information. INPUT_WALK_ACCESS_FILEFile with fasttrips walk access information. MODE_ACCESS_BIKE_OWNAccess mode: Bike (own) MODE_ACCESS_BIKE_SHAREAccess mode: Bike (share) MODE_ACCESS_KNRAccess mode: Drive to KNR MODE_ACCESS_PNRAccess mode: Drive to PNR MODE_ACCESS_WALKAccess mode: Walk MODE_COLUMN_MODEmode column MODE_COLUMN_MODE_NUMmode number MODE_EGRESS_BIKE_OWNEgress mode: Bike (own) MODE_EGRESS_BIKE_SHAREEgress mode: Bike (share) MODE_EGRESS_KNREgress mode: Drive to KNR MODE_EGRESS_PNREgress mode: Drive to PNR MODE_EGRESS_WALKEgress mode: Walk OUTPUT_ACCESS_EGRESS_FILEFile with access/egress links for C++ extension It’s easier to pass it via a file rather than through the initialize_fasttrips_extension() because of the strings involved, I think. WALK_ACCESS_COLUMN_ACC_COSTWalk acess cost column name: Link generic cost for accessing stop from TAZ. WALK_ACCESS_COLUMN_AUTO_CAPACITYfasttrips Walk access links column name: Auto Capacity, vehicles per hour per mile. WALK_ACCESS_COLUMN_DIRECTIONWalk access links column name: Direction (access or egress) WALK_ACCESS_COLUMN_DISTWalk access links column name: Walk Distance WALK_ACCESS_COLUMN_EGR_COSTWalk acess cost column name: Link generic cost for egressing to TAZ from stop. WALK_ACCESS_COLUMN_ELEVATION_GAINfasttrips Walk access links column name: Elevation Gain, feet gained along link. WALK_ACCESS_COLUMN_EMPLOYMENT_DENSITYfasttrips Walk access links column name: Employment Density, employees per square mile. WALK_ACCESS_COLUMN_INDIRECTNESSfasttrips Walk access links column name: Indirectness, ratio of Manhattan distance to crow-fly distance. WALK_ACCESS_COLUMN_POPULATION_DENSITYfasttrips Walk access links column name: Population Density, people per square mile. WALK_ACCESS_COLUMN_STOPWalk access links column name: Stop Identifier. WALK_ACCESS_COLUMN_STOP_NUMWalk access links column name: Stop Numerical Identifier. WALK_ACCESS_COLUMN_SUPPLY_MODEWalk access links column name: Supply mode. WALK_ACCESS_COLUMN_SUPPLY_MODE_NUMWalk access links column name: Supply mode number. WALK_ACCESS_COLUMN_TAZWalk access links column name: TAZ Identifier. WALK_ACCESS_COLUMN_TAZ_NUMWalk access links column name: TAZ Numerical Identifier. WALK_ACCESS_COLUMN_TIMEWalk access links column name: Link walk time. WALK_ACCESS_COLUMN_TIME_MINWalk access links column name: Link walk time in minutes. WALK_MODE_NUMSWalk mode number list -
add_distance(links_df, dist_col)[source]¶ Sets distance column value for access and egress links.
Todo
This neglects the start_time/end_time issue. Don’t use without fixing.
-
write_access_egress_for_extension(output_dir)[source]¶ Write the access and egress links to a single output file for the C++ extension to read. It’s in this form because I’m not sure how to pass the strings to C++ in Assignment.initialize_fasttrips_extension so I know that’s inconsistent, but it’s a time sink to investigate, so I’ll leave this for now
Todo
clean this up? Rename intermediate files (they’re not really output)
-
ACCESS_EGRESS_MODES= ['walk', 'bike_own', 'bike_share', 'PNR', 'KNR']¶ access and egress modes. First is default.
-
ACCESS_MODE_NUMS= [101, 102, 103, 104, 105]¶ Access mode number list, in order of ACCESS_EGRESS_MODES
-
BIKE_MODE_NUMS= [102, 103, 202, 203]¶ Bike mode number list
-
DAP_COLUMN_CAPACITY= 'capacity'¶ fasttrips DAP column name: Capacity (number of parking spaces)
-
DAP_COLUMN_DROP_OFF= 'drop_off'¶ fasttrips DAP column name: Drop-Off. Boolean.
-
DAP_COLUMN_HOURLY_COST= 'hourly_cost'¶ fasttrips DAP column name: Hourly Cost in cents. Integer.
-
DAP_COLUMN_LOT_ID= 'lot_id'¶ fasttrips DAP column name: Lot ID. String.
-
DAP_COLUMN_LOT_LATITUDE= 'lot_lat'¶ fasttrips DAP column name: Lot Latitude (WGS 84)
-
DAP_COLUMN_LOT_LONGITUDE= 'lot_lon'¶ fasttrips DAP column name: Lot Longitude (WGS 84)
-
DAP_COLUMN_MAXIMUM_COST= 'max_cost'¶ fasttrips DAP column name: Maximum Daily Cost in cents. Integer.
-
DAP_COLUMN_NAME= 'name'¶ fasttrips DAP column name: Name of the Lot. String.
-
DAP_COLUMN_TYPE= 'type'¶ fasttrips DAP column name: Type
-
DRIVE_ACCESS_COLUMN_AUTO_CAPACITY= 'auto_capacity'¶ fasttrips Drive access links column name: Auto Capacity, vehicles per hour per mile. Float.
-
DRIVE_ACCESS_COLUMN_COST= 'cost'¶ Drive access links column name: Drive cost in cents (integer)
-
DRIVE_ACCESS_COLUMN_DIRECTION= 'direction'¶ Drive access links column name: Direction (‘access’ or ‘egress’)
-
DRIVE_ACCESS_COLUMN_DISTANCE= 'dist'¶ Drive access links column name: Drive distance
-
DRIVE_ACCESS_COLUMN_DRIVE_DISTANCE= 'drive_dist'¶ fasttrips These are the original attributes but renamed to be clear they are the drive component (as opposed to the walk)
-
DRIVE_ACCESS_COLUMN_DRIVE_TRAVEL_TIME= 'drive_travel_time'¶
-
DRIVE_ACCESS_COLUMN_DRIVE_TRAVEL_TIME_MIN= 'drive_time_min'¶ Drive access links column name: Driving time in minutes between TAZ and lot (float)
-
DRIVE_ACCESS_COLUMN_ELEVATION_GAIN= 'elevation_gain'¶ fasttrips Drive access links column name: Elevation Gain, feet gained along link.
-
DRIVE_ACCESS_COLUMN_END_TIME= 'end_time'¶ Drive access links column name: End time (e.g. time period these attributes apply). A DateTime instance
-
DRIVE_ACCESS_COLUMN_END_TIME_MIN= 'end_time_min'¶ Drive access links column name: End time (e.g. time period these attributes apply), minutes after midnight
-
DRIVE_ACCESS_COLUMN_INDIRECTNESS= 'indirectness'¶ fasttrips Drive access links column name: Indirectness, ratio of Manhattan distance to crow-fly distance. Float.
-
DRIVE_ACCESS_COLUMN_LOT_ID= 'lot_id'¶ Drive access links column name: Stop Identifier. String.
-
DRIVE_ACCESS_COLUMN_POPULATION_DENSITY= 'population_density'¶ fasttrips Drive access links column name: Population Density, people per square mile. Float.
-
DRIVE_ACCESS_COLUMN_RETAIL_DENSITY= 'retail_density'¶ fasttrips Drive access links column name: Retail Density, employees per square mile. Float.
-
DRIVE_ACCESS_COLUMN_START_TIME= 'start_time'¶ Drive access links column name: Start time (e.g. time period these attributes apply). A DateTime instance
-
DRIVE_ACCESS_COLUMN_START_TIME_MIN= 'start_time_min'¶ Drive access links column name: Start time (e.g. time period these attributes apply), minutes after midnight
-
DRIVE_ACCESS_COLUMN_STOP= 'stop_id'¶ fasttrips Drive access links column name: Stop Numerical Identifier. Int.
-
DRIVE_ACCESS_COLUMN_STOP_NUM= 'stop_id_num'¶ fasttrips Drive access links column name: Stop Numerical Identifier. Int.
-
DRIVE_ACCESS_COLUMN_SUPPLY_MODE= 'supply_mode'¶ fasttrips Drive access links column name: Supply mode. String.
-
DRIVE_ACCESS_COLUMN_SUPPLY_MODE_NUM= 'supply_mode_num'¶ Drive access links column name: Supply mode number. Int.
-
DRIVE_ACCESS_COLUMN_TAZ= 'taz'¶ Drive access links column name: TAZ Identifier. String.
-
DRIVE_ACCESS_COLUMN_TAZ_NUM= 'taz_num'¶ fasttrips Drive access links column name: TAZ Numerical Identifier. Int.
-
DRIVE_ACCESS_COLUMN_TRAVEL_TIME= 'travel_time'¶ Drive access links column name: Driving time in minutes between TAZ and lot (TimeDelta)
-
DRIVE_ACCESS_COLUMN_WALK_DISTANCE= 'walk_dist'¶ fasttrips Drive access links column name: Walk distance from lot to transit. Miles. Float.
-
DRIVE_ACCESS_COLUMN_WALK_TIME= 'walk_time'¶ fasttrips Drive access links column name: Walk time from lot to transit. TimeDelta.
-
DRIVE_ACCESS_COLUMN_WALK_TIME_MIN= 'walk_time_min'¶ fasttrips Drive access links column name: Walk time from lot to transit. Int.
-
DRIVE_MODE_NUMS= [104, 105, 204, 205]¶ Drive mode number list
-
EGRESS_MODE_NUMS= [201, 202, 203, 204, 205]¶ Egress mode number list, in order of ACCESS_EGRESS_MODES
-
INPUT_DAP_FILE= 'drive_access_points_ft.txt'¶ File with fasttrips drive access points information. See Drive access points specification.
-
INPUT_DRIVE_ACCESS_FILE= 'drive_access_ft.txt'¶ File with fasttrips drive access information. See drive_access specification.
-
INPUT_WALK_ACCESS_FILE= 'walk_access_ft.txt'¶ File with fasttrips walk access information. See walk_access specification.
-
MODE_ACCESS_BIKE_OWN= 102¶ Access mode: Bike (own)
-
MODE_ACCESS_BIKE_SHARE= 103¶ Access mode: Bike (share)
-
MODE_ACCESS_KNR= 105¶ Access mode: Drive to KNR
-
MODE_ACCESS_PNR= 104¶ Access mode: Drive to PNR
-
MODE_ACCESS_WALK= 101¶ Access mode: Walk
-
MODE_COLUMN_MODE= 'mode'¶ mode column
-
MODE_COLUMN_MODE_NUM= 'mode_num'¶ mode number
-
MODE_EGRESS_BIKE_OWN= 202¶ Egress mode: Bike (own)
-
MODE_EGRESS_BIKE_SHARE= 203¶ Egress mode: Bike (share)
-
MODE_EGRESS_KNR= 205¶ Egress mode: Drive to KNR
-
MODE_EGRESS_PNR= 204¶ Egress mode: Drive to PNR
-
MODE_EGRESS_WALK= 201¶ Egress mode: Walk
-
OUTPUT_ACCESS_EGRESS_FILE= 'ft_intermediate_access_egress.txt'¶ File with access/egress links for C++ extension It’s easier to pass it via a file rather than through the initialize_fasttrips_extension() because of the strings involved, I think.
-
WALK_ACCESS_COLUMN_ACC_COST= 'access_cost'¶ Walk acess cost column name: Link generic cost for accessing stop from TAZ. Float.
-
WALK_ACCESS_COLUMN_AUTO_CAPACITY= 'auto_capacity'¶ fasttrips Walk access links column name: Auto Capacity, vehicles per hour per mile. Float.
-
WALK_ACCESS_COLUMN_DIRECTION= 'direction'¶ Walk access links column name: Direction (access or egress)
-
WALK_ACCESS_COLUMN_DIST= 'dist'¶ Walk access links column name: Walk Distance
-
WALK_ACCESS_COLUMN_EGR_COST= 'egress_cost'¶ Walk acess cost column name: Link generic cost for egressing to TAZ from stop. Float.
-
WALK_ACCESS_COLUMN_ELEVATION_GAIN= 'elevation_gain'¶ fasttrips Walk access links column name: Elevation Gain, feet gained along link.
-
WALK_ACCESS_COLUMN_EMPLOYMENT_DENSITY= 'employment_density'¶ fasttrips Walk access links column name: Employment Density, employees per square mile. Float.
-
WALK_ACCESS_COLUMN_INDIRECTNESS= 'indirectness'¶ fasttrips Walk access links column name: Indirectness, ratio of Manhattan distance to crow-fly distance. Float.
-
WALK_ACCESS_COLUMN_POPULATION_DENSITY= 'population_density'¶ fasttrips Walk access links column name: Population Density, people per square mile. Float.
-
WALK_ACCESS_COLUMN_STOP= 'stop_id'¶ Walk access links column name: Stop Identifier. String.
-
WALK_ACCESS_COLUMN_STOP_NUM= 'stop_id_num'¶ Walk access links column name: Stop Numerical Identifier. Int.
-
WALK_ACCESS_COLUMN_SUPPLY_MODE= 'supply_mode'¶ Walk access links column name: Supply mode. String.
-
WALK_ACCESS_COLUMN_SUPPLY_MODE_NUM= 'supply_mode_num'¶ Walk access links column name: Supply mode number. Int.
-
WALK_ACCESS_COLUMN_TAZ= 'taz'¶ Walk access links column name: TAZ Identifier. String.
-
WALK_ACCESS_COLUMN_TAZ_NUM= 'taz_num'¶ Walk access links column name: TAZ Numerical Identifier. Int.
-
WALK_ACCESS_COLUMN_TIME= 'time'¶ Walk access links column name: Link walk time. This is a TimeDelta
-
WALK_ACCESS_COLUMN_TIME_MIN= 'time_min'¶ Walk access links column name: Link walk time in minutes. This is float.
-
WALK_MODE_NUMS= [101, 201]¶ Walk mode number list
-
drive_access_df= None¶ Drive access links table. Make sure TAZ ID and lot ID are read as strings.
-
walk_access_df= None¶ Walk access links table. Make sure TAZ ID and stop ID are read as strings.
-