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

PMTiles: invert y axis of tile coordinates #44

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

hfs
Copy link
Contributor

@hfs hfs commented Jan 3, 2024

Hey @tsmock,

this is a small follow-up request to 4af7ac2. I think there’s a small logical error when calculating the XYZ tiles to download given the current viewport bounding box.

If the bounding box happens to span at least two rows of tiles, the generated list of tiles to download from TileXYZ.tilesFromBBox() is empty.

The y axis of XYZ tiles is oriented from north to south. When enumerating tiles for a given bounding box, the y coordinates have to be enumerated from north/top to south/bottom. Top/bottom have to be switched in the function.

The y axis of XYZ tiles is oriented from north to south. When
enumerating tiles for a given bounding box, the y coordinates have to be
enumerated from north/top to south/bottom.
@hfs hfs force-pushed the pmtiles-tile-coordinates branch from e715b14 to d13d61f Compare January 3, 2024 16:45
@tsmock
Copy link
Collaborator

tsmock commented Jan 3, 2024

That could definitely be the case. I'll have to write a test for it though.

@tsmock tsmock merged commit d13d61f into JOSM:master Jan 3, 2024
10 checks passed
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.

2 participants