8d817e42d7ed4f7dd4a6196d963eaef20cb1c684,osmnx/save_load.py,,save_graph_shapefile,#Any#Any#Any#Any#,69

Before Change


    G_save = get_undirected(G.copy())

    // create a GeoDataFrame of the nodes and set CRS
    nodes = {node:data for node, data in G_save.nodes(data=True)}
    gdf_nodes = gpd.GeoDataFrame(nodes).T
    gdf_nodes.crs = G_save.graph["crs"]

    // create a geometry column then drop the x and y columns
    gdf_nodes["geometry"] = gdf_nodes.apply(lambda row: Point(row["x"], row["y"]), axis=1)
    gdf_nodes = gdf_nodes.drop(["x", "y"], axis=1)

    // make everything but geometry column a string
    gdf_nodes["osmid"] = gdf_nodes["osmid"].astype(np.int64)
    for col in [c for c in gdf_nodes.columns if not c == "geometry"]:
        gdf_nodes[col] = gdf_nodes[col].fillna("").map(make_str)

    // create a list to hold our edges, then loop through each edge in the graph

After Change


    G_save = get_undirected(G.copy())

    // create a GeoDataFrame of the nodes and set CRS
    nodes_data = [data for _, data in G_save.nodes(data=True)]
    gdf_nodes = gpd.GeoDataFrame(nodes_data, index=G_save.nodes(data=False))
    gdf_nodes.crs = G_save.graph["crs"]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: gboeing/osmnx
Commit Name: 8d817e42d7ed4f7dd4a6196d963eaef20cb1c684
Time: 2018-12-30
Author: jonas.klasen@moia.io
File Name: osmnx/save_load.py
Class Name:
Method Name: save_graph_shapefile


Project Name: gboeing/osmnx
Commit Name: 8d817e42d7ed4f7dd4a6196d963eaef20cb1c684
Time: 2018-12-30
Author: jonas.klasen@moia.io
File Name: osmnx/save_load.py
Class Name:
Method Name: graph_to_gdfs


Project Name: gboeing/osmnx
Commit Name: 8d817e42d7ed4f7dd4a6196d963eaef20cb1c684
Time: 2018-12-30
Author: jonas.klasen@moia.io
File Name: osmnx/projection.py
Class Name:
Method Name: project_graph