-
Notifications
You must be signed in to change notification settings - Fork 27
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
Question: determination of neighbors when using snap
#177
Comments
@JosiahParry would it help if I created an instrumented branch, printing out values to the terminal? There is quite a lot of legacy code - the parts used when IIRC the bounding boxes (envelopes) are expanded by Lines 85 to 110 in 4cb8ba9
In the queen case, I'd need to check more to see whether symmetry is used (if i neighbours j, then j must neighbour i). |
This is incredibly helpful. Thank you! If you'd like to make a branch with some messages along the way, that could be quite helpful. I think the logic itself makes sense though. For queen contiguity we just need to be sure that there is a vertex somewhere close enough. And an edge consists to two points, so if we have two points within the tolerance they might be an edge |
Yes, the Lines 200 to 201 in 4cb8ba9
foundInBox object respects snap for probably all but using s2 cases for sf objects - I need to check Lines 146 to 153 in 4cb8ba9
You are right that the rook criterion is two vertices within |
In thinking about this a bit more—I think it would be somewhat straightforward to perform a check to see if two sequential vertices are present within For determining if the two sequential vertices are within Check the first vertex. If it is within
|
spdep/man/poly2nb.Rd
Line 14 in 4cb8ba9
I'm trying to understand a bit more clearly how neighbors are identified when using a snap tolerance. I understand that the spatial index bounding box search is increased by
snap
, however, when matching neighbors, I'm not too sure I understand how we determine if 2 neighbors are adjacent.Is my reading of the code in
spdep/src/polypoly.c
Lines 182 to 206 in 4cb8ba9
The text was updated successfully, but these errors were encountered: