NREL / routee-compass

An energy-aware routing engine
https://nrel.github.io/routee-compass/
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

tree_to_geopandas function #211

Closed nreinicke closed 4 months ago

nreinicke commented 4 months ago

To support #200 we can create a new function tree_to_geopandas function that converts the "tree" key from the default result (python dictionary) into a geopandas dataframe.

Each Compass output row may have an entire tree, but, we do not want a GDF of trees (plural), we want instead to plot a single tree. Following the logic above, we can add one more index column so that each row is a link in a tree in a result:

for each Compass run result row _i_:
  for each tree _j_:
    for each tree branch _k_:
      create row for `_index` _i_, `_tree` _k_,  `_edge_id` edgeid(_k_)