import pybna bna = pybna.pyBNA(config="/home/spencer/dev/calbike/bakersfield/config.yaml") bna.calculate_scenario_connectivity("scenario", scenario_ids=["upgrades"]) # scores bna.score("automated.bakersfield_bna_scores_improved", scenario_id="upgrades", with_geoms=True) # travel travel_sheds bna.travel_sheds(["060290006002009"], "automated.bakersfield_hsr_travel_shed_improved", scenario_id="upgrades")
import pybna bna = pybna.pyBNA(config="/home/spencer/dev/calbike/bakersfield/existing/config.yaml") bna.export("/home/spencer/gis/calbike/bakersfield_existing.gpkg") bna.export_table( "generated.bakersfield_existing_edges", "/home/spencer/gis/calbike/bakersfield_existing.gpkg", layer="bna_edges_existing" ) bna.export_table( "automated.bakersfield_bna_scores", "/home/spencer/gis/calbike/bakersfield_existing.gpkg", layer="bna_scores_existing" ) bna.export_table( "automated.bakersfield_hsr_travel_shed", "/home/spencer/gis/calbike/bakersfield_existing.gpkg", layer="travel_shed_existing" ) bna = pybna.pyBNA(config="/home/spencer/dev/calbike/bakersfield/planned/config.yaml") bna.export("/home/spencer/gis/calbike/bakersfield_planned.gpkg") bna.export_table( "generated.bakersfield_planned_edges", "/home/spencer/gis/calbike/bakersfield_planned.gpkg", layer="bna_edges_planned" )
# stress s = pybna.Stress(config="/home/sgardner/config.yaml") s.drop_table("generated.bna_stress_seg_forward") s.drop_table("generated.bna_stress_seg_backward") s.drop_table("generated.bna_stress_cross_forward") s.drop_table("generated.bna_stress_cross_backward") s.segment_stress() s.crossing_stress() # at this point we need to parse the lts=low tags in the OSM # and override stress scores before proceeding # see process_lts.sql # connectivity bna = pybna.pyBNA(config="/home/sgardner/config.yaml") bna.build_network() bna.calculate_connectivity() # scores bna.score("automated.merced_planned_bna_scores", with_geoms=True, overwrite=True) # 3 mi travel shed around station bna.config.bna.connectivity.table = "automated.merced_planned_connected_blocks_3mi" bna.db_connectivity_table = "automated.merced_planned_connected_blocks_3mi" bna.sql_subs["connectivity_table"] = sql.Identifier( "merced_planned_connected_blocks_3mi") bna.sql_subs["connectivity_max_distance"] = sql.Literal(4830) bna.calculate_connectivity(blocks=["060470013023031", "060470013023032"])
import pybna bna = pybna.pyBNA(config="/home/spencer/dev/calbike/fresno/existing/config.yaml") bna.export("/home/spencer/gis/calbike/fresno_existing.gpkg") bna.export_table( "generated.fresno_existing_edges", "/home/spencer/gis/calbike/fresno_existing.gpkg", layer="bna_edges_existing" ) bna.export_table( "automated.fresno_bna_scores", "/home/spencer/gis/calbike/fresno_existing.gpkg", layer="bna_scores_existing" ) bna.export_table( "automated.fresno_hsr_travel_shed", "/home/spencer/gis/calbike/fresno_existing.gpkg", layer="travel_shed_existing" ) bna = pybna.pyBNA(config="/home/spencer/dev/calbike/fresno/planned/config.yaml") bna.export("/home/spencer/gis/calbike/fresno_planned.gpkg") bna.export_table( "generated.fresno_planned_edges", "/home/spencer/gis/calbike/fresno_planned.gpkg", layer="bna_edges_planned" )
import pybna bna = pybna.pyBNA(config="/home/spencer/dev/calbike/merced/config.yaml") bna.calculate_scenario_connectivity("scenario", scenario_ids=["upgrades"]) # scores bna.score("automated.bna_scores_improved", scenario_id="upgrades", with_geoms=True) # travel travel_sheds bna.travel_sheds(["060290006002009"], "automated.merced_hsr_travel_shed_improved", scenario_id="upgrades")
import pybna bna = pybna.pyBNA(config="/home/spencer/dev/calbike/fresno/config.yaml") bna.calculate_scenario_connectivity("scenario",scenario_ids=["upgrades"]) # scores bna.score("automated.bna_scores_improved",scenario_id="upgrades",with_geoms=True) # travel travel_sheds bna.travel_sheds( ["060290006002009"], "automated.fresno_hsr_travel_shed_improved", scenario_id="upgrades" )