Armax / Pokemon-GO-node-api

Pokemon GO api node.js library
MIT License
875 stars 198 forks source link

Neighboring cells only to the west #91

Closed brettstack closed 8 years ago

brettstack commented 8 years ago

So I plotted the center points of the neighboring cells and got this map of neighboring cells. Compare that to another map I have plotted with the red marker showing the location of the character for that heartbeat. As you can see, the neighboring cells are spanning to the left/west. Is this a bug or am I misunderstanding the intent? I would have assumed it would get neighboring cells in all directions.

dotomaz commented 8 years ago

That's because of how hilbert curve in s2 library works. Ultimately if you go a couple of cells back and a couple next you'll get complete coverage of surrounding cells.

brettstack commented 8 years ago

Could you explain with code what you mean, "if you go a couple of cells back and a couple next"?

On Sat, 23 Jul 2016, 01:14 dotomaz, notifications@github.com wrote:

That's because of how hilbert curve in s2 library http://blog.christianperone.com/2015/08/googles-s2-geometry-on-the-sphere-cells-and-hilbert-curve/ works. Ultimately if you go a couple of cells back and a couple next you'll get complete coverage of surrounding cells.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Armax/Pokemon-GO-node-api/issues/91#issuecomment-234706505, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy6l1fRBGF3ypqEFJipjtx923Kvo3Upks5qYc10gaJpZM4JTS4u .

dotomaz commented 8 years ago

See the getNeighbors() function in poke.io.js

brettstack commented 8 years ago

That's the function that is generating these west-only cells, so the code there does not help me :(

Armax commented 8 years ago

we are still working on the s2 library