def get_multiyear_data(project_fc, project_type, base_df, analysis_year): ilut_val_fields = [p.col_pop_ilut, p.col_du, p.col_emptot, p.col_k12_enr, p.col_empind, p.col_persntrip_res] \ + p.ilut_ptrip_mode_fields fc_pcl_pt = p.parcel_pt_fc_yr(year) fc_pcl_poly = p.parcel_poly_fc_yr(year) fc_modelhwylinks = p.model_links_fc(year) year_dict = {} # get data on pop, job, k12 totals # point_sum(fc_pclpt, fc_project, project_type, val_fields, buffdist, case_field=None, case_excs_list=[]) ilut_buff_vals = lu_pt_buff.point_sum(fc_pcl_pt, project_fc, project_type, ilut_val_fields, p.ilut_sum_buffdist, case_field=None, case_excs_list=[]) ilut_indjob_share = {"{}_jobshare".format(p.col_empind): ilut_buff_vals[p.col_empind] / ilut_buff_vals[p.col_emptot]} ilut_buff_vals.update(ilut_indjob_share) ilut_mode_split = {"{}_share".format(modetrp): ilut_buff_vals[modetrp] / ilut_buff_vals[p.col_persntrip_res] for modetrp in p.ilut_ptrip_mode_fields} ilut_buff_vals.update(ilut_mode_split) # cleanup to remove non-percentage mode split values, if we want to keep output CSV from getting too long. # for trip_numcol in p.ilut_ptrip_mode_fields: del ilut_buff_vals[trip_numcol] # job + du total job_du_tot = {"SUM_JOB_DU": ilut_buff_vals[p.col_du] + ilut_buff_vals[p.col_emptot]} # model-based vehicle occupancy veh_occ_data = link_occ.get_linkoccup_data(project_fc, project_type, fc_modelhwylinks) # land use diversity index mix_index_data = mixidx.get_mix_idx(fc_pcl_pt, project_fc, project_type) # housing type mix housing_mix_data = lu_pt_buff.point_sum(fc_pcl_pt, project_fc, project_type, [p.col_du], p.du_mix_buffdist, p.col_housing_type, case_excs_list=['Other']) # acres of "natural resources" (land use type = forest or agriculture) nat_resources_data = urbn.nat_resources(project_fc, project_type, fc_pcl_poly, year) # combine into dict for d in [ilut_buff_vals, job_du_tot, veh_occ_data, mix_index_data, housing_mix_data, nat_resources_data]: year_dict.update(d) # make dict into dataframe df_year_out = pd.DataFrame.from_dict(year_dict, orient='index') return df_year_out
ilut_buff_vals[modetrp] / ilut_buff_vals[p.col_persntrip_res] for modetrp in p.ilut_ptrip_mode_fields } ilut_buff_vals.update(ilut_mode_split) # cleanup to remove non-percentage mode split values, if we want to keep output CSV from getting too long. # for trip_numcol in p.ilut_ptrip_mode_fields: del ilut_buff_vals[trip_numcol] # job + du total job_du_tot = { "SUM_JOB_DU": ilut_buff_vals[p.col_du] + ilut_buff_vals[p.col_emptot] } # model-based vehicle occupancy veh_occ_data = link_occ.get_linkoccup_data(project_fc, project_type, fc_modelhwylinks) # land use diversity index mix_index_data = mixidx.get_mix_idx(fc_pcl_pt, project_fc, project_type) # housing type mix housing_mix_data = lu_pt_buff.point_sum(fc_pcl_pt, project_fc, project_type, [p.col_du], p.du_mix_buffdist, p.col_housing_type, case_excs_list=['Other']) # acres of "natural resources" (land use type = forest or agriculture) nat_resources_data = urbn.nat_resources(project_fc, fc_pcl_poly, year)
"{}_share".format(modetrp): ilut_buff_vals[modetrp] / ilut_buff_vals[p.col_persntrip_res] for modetrp in p.ilut_ptrip_mode_fields } ilut_buff_vals.update(ilut_mode_split) # cleanup to remove non-percentage mode split values, if we want to keep output CSV from getting too long. # for trip_numcol in p.ilut_ptrip_mode_fields: del ilut_buff_vals[trip_numcol] # job + du total job_du_tot = { "SUM_JOB_DU": ilut_buff_vals[p.col_du] + ilut_buff_vals[p.col_emptot] } # model-based vehicle occupancy veh_occ_data = link_occ.get_linkoccup_data(project_fc, p.ptype_arterial, p.model_links_fc) # land use diversity index mix_index_data = mixidx.get_mix_idx(p.parcel_pt_fc, project_fc, p.ptype_arterial) # housing type mix housing_mix_data = lu_pt_buff.point_sum(p.parcel_pt_fc, project_fc, project_type, [p.col_du], p.du_mix_buffdist, p.col_housing_type, case_excs_list=['Other']) # acres of "natural resources" (land use type = forest or agriculture) nat_resources_data = urbn.nat_resources(project_fc, p.parcel_poly_fc, 2016)