Update neighbors function across International Date Line #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order to get tiles across the x International Date Line, this update will list the neighboring tiles across the 2**z and 0 divide.
The original version will not include tiles that are across the International Date Line (-180/180).
neighbors(Tile(0, 14, 9))
would create[Tile(x=0, y=13, z=9), Tile(x=0, y=15, z=9), Tile(x=1, y=13, z=9), Tile(x=1, y=14, z=9), Tile(x=1, y=15, z=9)]
In this code update, tiles that are at the International Date Line (-180/180) will create the neighboring Tile objects:
neighbours(Tile(0, 14, 9))
will create[Tile(x=511, y=13, z=9), Tile(x=511, y=14, z=9), Tile(x=511, y=15, z=9), Tile(x=0, y=13, z=9), Tile(x=0, y=15, z=9), Tile(x=1, y=13, z=9), Tile(x=1, y=14, z=9), Tile(x=1, y=15, z=9)]
neighbors(Tile(0,0,9))
will create[Tile(x=511, y=0, z=9), Tile(x=511, y=1, z=9), Tile(x=0, y=1, z=9), Tile(x=1, y=0, z=9), Tile(x=1, y=1, z=9)]
This change respects the y boundaries as not continuous, but expands the continuous nature of the x dimension.