msarahan / state-adjacency-graphs

project to create adjacency graphs for the US census blocks within states
1 stars 4 forks source link

`add_vertex` method #39

Open Seth-Rothschild opened 6 years ago

Seth-Rothschild commented 6 years ago

Any method on the MgggGraph object which adds or removes a vertex is necessarily more complicated than those that add or remove edges. To add a vertex, a user needs to provide at least an x coordinate, y coordinate and id.

However, even adding that row to MgggGraph.shape_df is insufficient to plot the graph, because there's no associated pysal object to find the centroid of. Hopefully that's the extent of the problem, but since the vertex doesn't show up in the loaded_geodata and loaded_polymap I'm anticipating problems there as well.

Seth-Rothschild commented 6 years ago

Seems like it's possible to bypass the centroid thing for the plot. Issue seems to be setting a reasonable index/id pair for the vertex. Answer to that might or might not be obvious.