def get_singleyr_data(fc_tripshedpoly, projtyp, adt, out_dict={}): print("getting accessibility data for base...") accdata = acc.get_acc_data(fc_tripshedpoly, p.accdata_fc, projtyp, get_ej=False) print("getting ag acreage data for base...") ag_acres = luac.get_lutype_acreage(fc_tripshedpoly, projtyp, p.parcel_poly_fc, p.lutype_ag) # total job + du density (base year only, for state-of-good-repair proj eval only) print("getting ILUT data for base...") job_du_dens = lu_pt_buff.point_sum_density(p.parcel_pt_fc, fc_tripshedpoly, projtyp, [p.col_emptot, p.col_du], p.ilut_sum_buffdist) comb_du_dens = sum(list(job_du_dens.values())) job_du_dens['job_du_perNetAcre'] = comb_du_dens # get EJ data print("getting EJ data for base...") ej_data = lu_pt_buff.point_sum(p.parcel_pt_fc, fc_tripshedpoly, projtyp, [p.col_pop_ilut], p.ilut_sum_buffdist, p.col_ej_ind, case_excs_list=[]) ej_flag_dict = {0: "Pop_NonEJArea", 1: "Pop_EJArea"} # rename keys from 0/1 to more human-readable names ej_data = utils.rename_dict_keys(ej_data, ej_flag_dict) ej_data["Pct_PopEJArea"] = ej_data["Pop_EJArea"] / sum(list(ej_data.values())) accdata_ej = acc.get_acc_data(fc_tripshedpoly, p.accdata_fc, projtyp, get_ej=True) # EJ accessibility data ej_data.update(accdata_ej) # for base dict, add items that only have a base year value (no future year values) for d in [accdata, ag_acres, job_du_dens, ej_data]: out_dict_base.update(d) outdf = pd.DataFrame.from_dict(out_dict_base, orient='index') return outdf
def get_singleyr_data(fc_project, projtyp, adt, posted_speedlim, out_dict={}): pcl_pt_fc = p.parcel_pt_fc_yr(2016) pcl_poly_fc = p.parcel_poly_fc_yr(2016) accdata = acc.get_acc_data(fc_project, p.accdata_fc, projtyp, get_ej=False) collision_data = coll.get_collision_data(fc_project, projtyp, p.collisions_fc, adt) complete_street_score = {'complete_street_score': -1} if projtyp == p.ptype_fwy else \ cs.complete_streets_idx(pcl_pt_fc, fc_project, projtyp, posted_speedlim, p.trn_svc_fc) truck_route_pct = {'pct_proj_STAATruckRoutes': 1} if projtyp == p.ptype_fwy else \ linex.get_line_overlap(fc_project, p.freight_route_fc, p.freight_route_fc) # all freeways are STAA truck routes ag_acres = luac.get_lutype_acreage(fc_project, projtyp, pcl_poly_fc, p.lutype_ag) pct_adt_truck = {"pct_truck_aadt": -1} if projtyp != p.ptype_fwy else truck_fwy.get_tmc_truck_data(fc_project, projtyp) intersxn_data = intsxn.intersection_density(fc_project, p.intersections_base_fc, projtyp) npmrds_data = npmrds.get_npmrds_data(fc_project, projtyp) transit_data = trnsvc.transit_svc_density(fc_project, p.trn_svc_fc, projtyp) bikeway_data = bnmi.get_bikeway_mileage_share(fc_project, p.ptype_sgr) infill_status = urbn.projarea_infill_status(fc_project, p.comm_types_fc) # total job + du density (base year only, for state-of-good-repair proj eval only) job_du_dens = lu_pt_buff.point_sum_density(pcl_pt_fc, fc_project, projtyp, [p.col_emptot, p.col_du], p.ilut_sum_buffdist) comb_du_dens = sum(list(job_du_dens.values())) job_du_dens['job_du_perNetAcre'] = comb_du_dens # get EJ data ej_data = lu_pt_buff.point_sum(pcl_pt_fc, fc_project, projtyp, [p.col_pop_ilut], p.ilut_sum_buffdist, p.col_ej_ind, case_excs_list=[]) ej_flag_dict = {0: "Pop_NonEJArea", 1: "Pop_EJArea"} # rename keys from 0/1 to more human-readable names ej_data = utils.rename_dict_keys(ej_data, ej_flag_dict) ej_data["Pct_PopEJArea"] = ej_data["Pop_EJArea"] / sum(list(ej_data.values())) accdata_ej = acc.get_acc_data(fc_project, p.accdata_fc, projtyp, get_ej=True) # EJ accessibility data ej_data.update(accdata_ej) # for base dict, add items that only have a base year value (no future year values) for d in [accdata, collision_data, complete_street_score, truck_route_pct, pct_adt_truck, ag_acres, intersxn_data, npmrds_data, transit_data, bikeway_data, infill_status, job_du_dens, ej_data]: out_dict_base.update(d) outdf = pd.DataFrame.from_dict(out_dict_base, orient='index') return outdf
comb_du_dens = sum(list(job_du_dens.values())) job_du_dens['job_du_perNetAcre'] = comb_du_dens # get EJ data ej_data = lu_pt_buff.point_sum(p.parcel_pt_fc, project_fc, project_type, [p.col_pop_ilut], p.ilut_sum_buffdist, p.col_ej_ind, case_excs_list=[]) ej_flag_dict = { 0: "Pop_NonEJArea", 1: "Pop_EJArea" } # rename keys from 0/1 to more human-readable names ej_data = utils.rename_dict_keys(ej_data, ej_flag_dict) ej_data["Pct_PopEJArea"] = ej_data["Pop_EJArea"] / sum( list(ej_data.values())) accdata_ej = acc.get_acc_data(project_fc, p.accdata_fc, project_type, get_ej=True) # EJ accessibility data ej_data.update(accdata_ej) # for base dict, add items that only have a base year value (no future year values) for d in [ accdata, collision_data, complete_street_score, truck_route_pct, pct_adt_truck, ag_acres, intersxn_data, npmrds_data, transit_data, bikeway_data, infill_status, job_du_dens, ej_data ]: