Skip to content
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

Update neighbors function across International Date Line #150

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gspeed0689
Copy link

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).

  • Previously 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.

In order to get tiles across the x meridian, this update will list the neighboring tiles across the 2**z and 0 divide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant