1989d2b43c9ab0797f352ecdfd288814c4eba306,osmnx/projection.py,,project_graph,#Any#Any#,126

Before Change


    start_time = time.time()

    // create a GeoDataFrame of the nodes, name it, convert osmid to str
    nodes_data = [data for _, data in G_proj.nodes(data=True)]
    gdf_nodes = gpd.GeoDataFrame(nodes_data, index=G_proj.nodes(data=False))
    gdf_nodes.crs = G_proj.graph["crs"]
    gdf_nodes.gdf_name = "{}_nodes".format(G_proj.name)

    // create new lat/lon columns just to save that data for later, and create a
    // geometry column from x/y
    gdf_nodes["lon"] = gdf_nodes["x"]
    gdf_nodes["lat"] = gdf_nodes["y"]
    gdf_nodes["geometry"] = gdf_nodes.apply(lambda row: Point(row["x"], row["y"]), axis=1)
    log("Created a GeoDataFrame from graph in {:,.2f} seconds".format(time.time()-start_time))

After Change


    start_time = time.time()

    // create a GeoDataFrame of the nodes, name it, convert osmid to str
    node_data = [list(i) for i in zip(*G_proj.nodes(data=True))]
    gdf_nodes = gpd.GeoDataFrame(node_data[1], index=node_data[0])
    gdf_nodes.crs = G_proj.graph["crs"]
    gdf_nodes.gdf_name = "{}_nodes".format(G_proj.name)

    // create new lat/lon columns just to save that data for later, and create a
    // geometry column from x/y
    gdf_nodes["lon"] = gdf_nodes["x"]
    gdf_nodes["lat"] = gdf_nodes["y"]
    gdf_nodes["geometry"] = gdf_nodes.apply(lambda row: Point(row["x"], row["y"]), axis=1)
    log("Created a GeoDataFrame from graph in {:,.2f} seconds".format(time.time()-start_time))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: gboeing/osmnx
Commit Name: 1989d2b43c9ab0797f352ecdfd288814c4eba306
Time: 2019-01-01
Author: jonas.klasen@moia.io
File Name: osmnx/projection.py
Class Name:
Method Name: project_graph


Project Name: gboeing/osmnx
Commit Name: 1989d2b43c9ab0797f352ecdfd288814c4eba306
Time: 2019-01-01
Author: jonas.klasen@moia.io
File Name: osmnx/save_load.py
Class Name:
Method Name: save_graph_shapefile


Project Name: gboeing/osmnx
Commit Name: 1989d2b43c9ab0797f352ecdfd288814c4eba306
Time: 2019-01-01
Author: jonas.klasen@moia.io
File Name: osmnx/projection.py
Class Name:
Method Name: project_graph


Project Name: gboeing/osmnx
Commit Name: 1989d2b43c9ab0797f352ecdfd288814c4eba306
Time: 2019-01-01
Author: jonas.klasen@moia.io
File Name: osmnx/save_load.py
Class Name:
Method Name: graph_to_gdfs