-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Convert get all tile coords to iterator #463
Conversation
https://github.com/onthegomap/planetiler/actions/runs/4097987936 ℹ️ Base Logs 88daeb4
ℹ️ This Branch Logs f35b83c
|
A couple thoughts:
|
That could possibly work - where would something like tileOrder go though?
I don't see a need for it to return tiles in a specific order, I'd expect it to respect
That seems interesting if we needed to check tile IDs in random order, but I think a memory-efficient iterator would be simplest to implement. We could always layer something like that on top of an efficient iterator if the need arises. Also what do you think instead of iterating over the coordinates and tile data? |
Overall LGTM, if the main use case is for unit/integration tests then getting a total Set of all TileCoords is easier for pmtiles reading than the memory-efficient iterator. Iterating over coordinates and tile data can be awkward because of deduplication in both mbtiles/pmtiles as well as RLE in pmtiles, potentially we're feeding a consumer of that iterator a lot of extra work, unless we exposed not just |
OK let's start with this for now, at the very least any tile archive should be able to serve the getTile API and most likely listTiles as well, but if it ends up being problematic we could push the list API down into mbtiles and have a separate list API for different implementations. I could maybe see some key/value store supporting random access but not the ability to list tiles. |
Kudos, SonarCloud Quality Gate passed! |
} | ||
|
||
/** Returns the raw tile data associated with the tile at coordinate {@code x, y, z}. */ | ||
byte[] getTile(int x, int y, int z); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How should this handle the case of the tile not existing? should it be an option return type? It doesn't seem exceptional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry the javadoc should indicate this, but it should return null
if not found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #486 to fix the javadoc.
Pull mbtiles access methods up to
TileArchive
and change signature for listing tile coordinates to return aCloseableIterator
so you can iterate through all coordinates in the archive without pulling the whole list into memory.