Skip to content

Extending lines does not reduce subgraph/connected component counts w/ primal approach? #356

Answered by martinfleis
tomrod asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

This is an expected behaviour. When creating networkx graph using gdf_to_nx, momepy infers topology of the network from the endpoints of the line strings. Which means that to create an intersection, endpoints of all line strings need to coincide at that point. If you just extend the lines to visually intersect the others, it does not create nodes there and treats such an intersection as non-planar, as if it was a bridge for example.

I don't really have a universal solution for this case you are dealing with now. Snapping may be one option.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@tomrod
Comment options

Comment options

You must be logged in to vote
2 replies
@tomrod
Comment options

@tomrod
Comment options

Answer selected by tomrod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants