Skip to content

Commit

Permalink
get true shape from shapes_df
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-sijia committed May 12, 2020
1 parent b3f0dd9 commit ffa9b3e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lasso/roadway.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ def rename_variables_for_dbf(
dbf_name_list += [c]

if "geometry" in dbf_df.columns:
if str(dbf_df["geometry"].geom_type[0]) == "Point":
if str(dbf_df["geometry"].iloc[0].geom_type) == "Point":
dbf_df["X"] = dbf_df.geometry.apply(lambda g: g.x)
dbf_df["Y"] = dbf_df.geometry.apply(lambda g: g.y)
dbf_name_list += ["X", "Y"]
Expand Down Expand Up @@ -1664,6 +1664,9 @@ def write_roadway_as_shp(
self.links_metcouncil_df, output_variables=dbf_link_output_variables
)

# network object does not store true shape in the links_df
links_dbf_df["geometry"] = self.shapes_metcouncil_df["geometry"]

WranglerLogger.info("Writing Node Shapes:\n - {}".format(output_node_shp))
nodes_dbf_df.to_file(output_node_shp)
WranglerLogger.info("Writing Link Shapes:\n - {}".format(output_link_shp))
Expand Down

1 comment on commit ffa9b3e

@i-am-sijia
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#70

Please sign in to comment.