Skip to content

Update neighbors function across International Date Line#150

Open
gspeed0689 wants to merge 1 commit intomapbox:mainfrom
gspeed0689:neighbors_across_meridian
Open

Update neighbors function across International Date Line#150
gspeed0689 wants to merge 1 commit intomapbox:mainfrom
gspeed0689:neighbors_across_meridian

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.

1 participant