-
Notifications
You must be signed in to change notification settings - Fork 0
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
Explore mechanisms for storing, indexing, and retrieving raster data #25
Comments
Started putting together a spreadsheet here: |
Per the spreadsheet linked above, if we take an image of size 1536 x 1024, this can be broken down into the following:
tile count relationship to Hilbert curve order:
We're only doing 7 successive tile divisions here (we'd never store the source image, tile 0, so we don't count that), which means a few things:
But if we expanded this at both the top and the bottom, we'd leave ourselves enough room for future growth:
For this level of future-proofing, we'd need 28 bits (to represent the max value of 2^14-1 * 2^14-1), and this would let us index down to the level of individual pixels. Not that we'd ever tile images to that level, but indexing to that level should let us query the database to find which tile has a given pixel coordinate. |
We'll want to try splitting up images into tiles, and then perform queries on pixels inside the tiles to see what the performance profile looks like ... if the tiles are created using RoaringBitmap, that project may already have some data we can use to select optimal tile size ... So, we're going to need two levels of query here:
If we do this, then ingest will be comprised of:
|
This takes care of the tiling; we'd also want to allocate bits for:
Google's s2 library also allocates a "stop" bit; might be good to borrow that, too. So, what about:
Total of 61 bits, pretty close to the s2 lib's 64 bits, but with a fairly different indexing profile and usage ... |
Would be interesting to see what the storage required would be to support a game that maxed out worlds and layers :-) |
Next steps: walk through some examples of a series of indices for different tiles. Let's walk through the logic of taking a current-resolution image (1600x1022) and splitting it up at different levels:
Pick a point in the middle of a tile for each of them:
Pick a point on the border of a tile, and repeat the same above. Does it still work? After this, we'll look at querying inside a tile ... |
Turns out the papers I found were pretty ... non-great. Time to do some more reading.
More readings:
Then sketches (as comments in this ticket or mock-ups in a spreadsheet):
The text was updated successfully, but these errors were encountered: