vtra.stats package

Submodules

vtra.stats.air_water_impacts module

Sum max/min total flow exposed under hazard scenarios at air and water network nodes

aggregate_flows(nodes_df, flows_df)[source]
join_hazards(nodes_with_flows_df, hazards_df)[source]
main()[source]
read_airports(airports_file)[source]
read_flows(flows_file)[source]
read_hazards(hazard_file)[source]
read_ports(ports_file_with_ids, ports_file_with_names)[source]
summarise(nodes_with_hazards_df)[source]

vtra.stats.boundary_hazard_percentages module

Summarise network-hazard intersections per-boundary (district, commune or province)

Purpose

Collect network-hazard intersection attributes
  • Combine with boundary Polygons to collect network-boundary intersection attributes
  • Write final results to an Excel sheet

Input data requirements

  1. Correct paths to all files and correct input parameters
  2. Shapefiles of network-hazard intersections results with attributes:
    • edge_id or node_id - String/Integer/Float Edge ID or Node ID of network
    • length - Float length of edge intersecting with hazards
    • geometry - Shapely geometry of edges as LineString or nodes as Points
  3. Shapefile of administrative boundaries of Vietnam with attributes:
    • province_i - String/Integer ID of Province
    • pro_name_e - String name of Province in English
    • district_i - String/Integer ID of District
    • dis_name_e - String name of District in English
    • commune_id - String/Integer ID of Commune
    • name_eng - String name of Commune in English
    • geometry - Shapely geometry of boundary Polygon

Results

  1. Excel sheet of network-hazard-boundary intersection with attributes:
    • edge_id/node_id - String name of intersecting edge ID or node ID
    • length - Float length of intersection of edge LineString and hazard Polygon: Only for edges
    • province_id - String/Integer ID of Province
    • province_name - String name of Province in English
    • district_id - String/Integer ID of District
    • district_name - String name of District in English
    • commune_id - String/Integer ID of Commune
    • commune_name - String name of Commune in English
main()[source]

Summarise intersections

  1. Specify the paths from where you to read and write:
    • Input data
    • Intermediate calcuations data
    • Output results
  2. Supply input data and parameters
    • Names of the three Provinces - List of string types
    • Names of modes - List of strings
    • Names of output modes - List of strings
    • Names of hazard bands - List of integers
    • Names of hazard thresholds - List of integers
    • Condition ‘Yes’ or ‘No’ is the users wants to process results
  3. Give the paths to the input data files:
    • Commune boundary and stats data shapefile
    • Hazard datasets description Excel file
    • String name of sheet in hazard datasets description Excel file
  4. Specify the output files and paths to be created

vtra.stats.flow_senstivities module

Summarise hazard data

Get OD data and process it

main()[source]

vtra.stats.national_roads_criticality_risk_stats module

Road network risks and adaptation maps

main()[source]

vtra.stats.network_boundary_stats module

Summarise length of edges/number of nodes within each boundary (commune, district, province)

Purpose

Collect network attributes
  • Combine with boundary Polygons to collect network-boundary intersection attributes
  • Write final results to an Excel sheet

Input data requirements

  1. Correct paths to all files and correct input parameters
  2. Shapefiles of networks with attributes:
    • edge_id or node_id - String/Integer/Float Edge ID or Node ID of network
    • length - Float length of edge intersecting with hazards
    • geometry - Shapely geometry of edges as LineString or nodes as Points
  3. Shapefile of administrative boundaries of Vietnam with attributes:
    • province_i - String/Integer ID of Province
    • pro_name_e - String name of Province in English
    • district_i - String/Integer ID of District
    • dis_name_e - String name of District in English
    • commune_id - String/Integer ID of Commune
    • name_eng - String name of Commune in English
    • geometry - Shapely geometry of boundary Polygon

Results

  1. Excel sheet of network-hazard-boundary intersection with attributes:
    • edge_id/node_id - String name of intersecting edge ID or node ID
    • length - Float length of intersection of edge LineString and hazard Polygon: Only for edges
    • province_id - String/Integer ID of Province
    • province_name - String name of Province in English
    • district_id - String/Integer ID of District
    • district_name - String name of District in English
    • commune_id - String/Integer ID of Commune
    • commune_name - String name of Commune in English
main()[source]

Summarise

  1. Specify the paths from where you to read and write:
    • Input data
    • Intermediate calcuations data
    • Output results
  2. Supply input data and parameters
    • Names of the three Provinces - List of string types
    • Names of modes - List of strings
    • Names of output modes - List of strings
    • Names of hazard bands - List of integers
    • Names of hazard thresholds - List of integers
    • Condition ‘Yes’ or ‘No’ is the users wants to process results
  3. Give the paths to the input data files:
    • Commune boundary and stats data shapefile
    • String name of sheet in hazard datasets description Excel file
  4. Specify the output files and paths to be created

vtra.stats.network_hazard_stats module

Summarise per-hazard total intersections (for the whole system)

Purpose

Collect network-hazard intersection attributes
  • Combine with boundary Polygons to collect network-boundary intersection attributes
  • Write final results to an Excel sheet

Input data requirements

  1. Correct paths to all files and correct input parameters
  2. Shapefiles of network-hazard intersections results with attributes:
    • edge_id or node_id - String/Integer/Float Edge ID or Node ID of network
    • length - Float length of edge intersecting with hazards
    • geometry - Shapely geometry of edges as LineString or nodes as Points
  3. Shapefile of administrative boundaries of Vietnam with attributes:
    • province_i - String/Integer ID of Province
    • pro_name_e - String name of Province in English
    • district_i - String/Integer ID of District
    • dis_name_e - String name of District in English
    • commune_id - String/Integer ID of Commune
    • name_eng - String name of Commune in English
    • geometry - Shapely geometry of boundary Polygon

Results

  1. Excel sheet of network-hazard-boundary intersection with attributes:
    • edge_id/node_id - String name of intersecting edge ID or node ID
    • length - Float length of intersection of edge LineString and hazard Polygon: Only for edges
    • province_id - String/Integer ID of Province
    • province_name - String name of Province in English
    • district_id - String/Integer ID of District
    • district_name - String name of District in English
    • commune_id - String/Integer ID of Commune
    • commune_name - String name of Commune in English
hazard_data_summary(hazard_network_dataframe, network_dataframe)[source]
main()[source]

Summarise

  1. Specify the paths from where you to read and write:
    • Input data
    • Intermediate calcuations data
    • Output results
  2. Supply input data and parameters
    • Names of the three Provinces - List of string types
    • Names of modes - List of strings
    • Names of output modes - List of strings
    • Names of hazard bands - List of integers
    • Names of hazard thresholds - List of integers
    • Condition ‘Yes’ or ‘No’ is the users wants to process results
  3. Give the paths to the input data files:
    • Commune boundary and stats data shapefile
    • Hazard datasets description Excel file
    • String name of sheet in hazard datasets description Excel file
  4. Specify the output files and paths to be created

vtra.stats.network_stats_calculations module

Summarise hazard data

Get OD data and process it

main()[source]

vtra.stats.province_roads_criticality_risk_stats module

Provincial road network risks and adaptation maps

main()[source]