-
Notifications
You must be signed in to change notification settings - Fork 186
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
CellId.AllNeighbors has documented but unchecked precondition #104
Comments
Can you put this in the form of a test case we can add to |
Line 271 in dc45a10
You can try @rsned Apparently go has no |
It is possible to set up a dcheck equivalent using go build tags. e.g. #141. There are a couple places where I noted the c++ checks something here, but not too many of the DCHECKs are directly referenced in the code. |
Return nil if level is too low (cells are too large and might not be neighbors) or higher than MaxLevel (no such cells exist). Weakens precondition of function. golang#104 complained that AllNeighbors was returning the wrong results, but the level precondition was being violated. Make this more obvious and less confusing.
ll1 := s2.LatLngFromDegrees(30.755702, 114.127656)
c1 := s2.CellIDFromLatLng(ll1)
neighbors := c1.AllNeighbors(8)
The text was updated successfully, but these errors were encountered: