Open DavidOry opened 4 years ago
Yep, it was coded this way because it was enough for base network, but for build scenarios, I can see it be error prone. We should join them using shape_id
that we generated as unique shape IDs.
@i-am-sijia
The geometries for new managed lanes links are missing from the shape file output, perhaps because they are getting computed and stored in links_dbf_df
but not in shapes_metcouncil_df
? Then this join ends up dropping them.
# network object does not store true shape in the links_df
links_dbf_df = pd.merge(
links_dbf_df.drop("geometry", axis = 1),
self.shapes_metcouncil_df[["shape_id", "geometry"]],
how = "left",
on = "shape_id"
)
Can we add the new shapes to shapes_metcouncil_df
when they are created or modify the merge
to replace geometry
when it is present in shapes_metcouncil_df
but not drop it from links_dbf_df
?
It was because the new shapes in shapes_df
has NaN
in columns such as toIntersectionId, fromIntersectionId, id
, and they get dropped in this line:
I added fill_na for shape_df
, so that new shapes can be pass along to shapes_metcouncil_df
@RachelWikenMC
fyi.. This test should address your issue of using the link_output_variables
parameter in this method.
fyi @i-am-sijia, @e-lo.
I'm getting some strange results. This line gives me pause:
It seems we should be joining on a key rather than just adding in the column. Any quick thoughts?