-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pysal doesn't efficiently recognize all neighbors #302
Comments
@sjsrey yes that's the same issue for me |
@sjsrey I managed to upgrade my libpysal but still I have the same problem.
I tried using ArcGis, to get neighbors and it works fine but I have a problem using the
If you can tell me how to fix any of the two options this would be of great help. Here the neighbors are fine, but then I can't see how many disconnected areas I have. |
When you say " i get an error. I need the scipy.sparse.csgraph.connected_components," can you be more specific and share the error message so that we might help? Any chance you can also share the shapefile so we can try to help you get what you need? |
@sjsrey Sorry for being not specific Here is also the text file for neighbors by ArcGIS |
Can you add the dbf and shx files? |
@sjsrey Thank you so much |
@sjsrey I corrected my shapefile so now it is valid but still some neighbors are not identified by libpysal
https://www.dropbox.com/sh/o2r0jssyin2udjy/AAACs6HFyUWPu7hUcu9TH0-ha?dl=0 |
I ran into a case that is very similar to the picture (two polygons that have a visibly common edge), but pysal cannot handle while shapely resolves the intersection to a MultiPoint with two coordinates. I resorted to convex hull (assuming the two distinct points correspond to a common edge, in rare cases it is possible that the two polygons only touch at exactly two points) |
For the instance you discuss, @prusswan, we might want to consider a pygeos-based implementation that only records the |
Isn't this resolved by @ljwolf if we refactor |
Would really like that!! |
I am using pysal function
ps.weights.Queen.from_shapefile
to calculate the neighbors of different polygons.However it can't identify all the neighbours as seen in the photo attached these two polygons are not identified as neighbors, is there a way to solve this problem?
I have found this link also talking about the same problem.
https://stackoverflow.com/questions/45758233/pysal-doesnt-recognize-some-polygon-neighbors
The text was updated successfully, but these errors were encountered: