Confusing explanation and output for momepy.neighbors #743
|
On the page for momepy.neighbors, firstly I think there is a typo because the first parameter is listed as I also get a confusing result when I run it with the following code: For reference, As far as I can tell, I am building the tessellation and contiguity graphs the same as the example, but if I join the result back to the buildings to inspect the results visually with: And the result looks like this:
This street alone looks crazy to me, how can these buildings have such wildly different numbers of neighbours when they are just row buildings?
Is it just not appropriate to join the results back to the source geometries like this? Or is there some subtlety about this algorithm that I am missing? |
Replies: 1 comment 2 replies
|
It captures precisely what the docstring says (besides the gdf/geometry mistake), that is the number of neighbours captured by |


It captures precisely what the docstring says (besides the gdf/geometry mistake), that is the number of neighbours captured by
graph, i.e. it just callsgraph.cardinalities. If that graph is generated on tessellation, that is number of neighbours that tessellation cell has. Not a number of neighbours a building does. If you generate contiguity from buildings, then it gives you info on how many other buildings it touches but that is not what you're supposed to get from tessellation graph.