Giter Club home page Giter Club logo

com-tiles's People

Contributors

mactrem avatar oreilles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

com-tiles's Issues

Improve performance of the conversion process for a planet scale tileset

Converting a continent sized MBTiles database like europe with about 21 gb takes only about 14 minutes.
But the conversion of a planet tileset with about 55 gb takes about 8 hours.
Task:

  • Improve query performance of the SQLIte database e.g. change database driver settings
  • Use prepared statements for the database queries
  • Use a worker pool to parallelize the conversion -> replace sqlite3 with better-sqlite3 for worker support

provider: add option to batch tile requests

Per default the individual tile requests should get batched to improve performance and in particular to reduce the storage costs. This can reduce the number of tile requests by about 90% on a 4k display and 50% on a HD display

Index redesign

The following primary requirements must be taken into consideration in the design of the index:
• Minimize the transferred amount of data and the number
of requests to reduce costs and latency
• Every tile in the archive can be requested with at most one
additional request
• Fast decoding of the index

As a case study evaluate the following approaches which have been already described on the spec page

  • Store only one absolute offset in addition to the size of the tiles in an index fragment.
    Use a bit aligned encoding for the size of a tile, with a default bit width of 20 bits which allow a max tile size of 1 mb.
    This leads to an index fragment size of 10k for 4096 index entries and an index size < 1 GB which can be also
    handled well when a COMTiles archive is used in combination with a serverless tileserver e.g. hosted on AWS
    lambda. A tile size of <= 1 MB is sufficient for a planet scale OSM MVT tileset e.g. generated with Planetiler.
    In addition a different bit width can be specified in the COMTiles metadata section.

  • Reduce of the index size while continuing to meet the above specified requirements. One approach could be to use a Bitvector encoding to reduce the index size of sparse tilesets. Since over 50% of the COMTiles index fragments of an OSM vector tileset are not present, this approach could significantly reduce the size of the index. This could be inspired by the implicit tiling extension of the 3DTiles spec that contains an availability section to efficiently encode sparse datasets. This Bitvector is approximately smaller then 10kb for a planet-scale z14 tileset, which would not introduce to much additional latency. This could reduce the size of the index to about 400 Mb.

  • Use an additional fragment table to allow the usage of a custom compression algorithm for the index fragments.
    This could enable the usage of a tile duplication technique inspired by PMTiles, which significantly can reduce the
    overall index size. The disadvantage is that this also leads to an additional initial fetch more.
    Related to the index fragment size this will probably be a kind of micro optimization in urban regions with a minor win (3x ->
    4k?). In the tests the ingeger compression algorithms that showed the best results in terms of the compression ratio and decoding speed was a adapted version of the ORC RLE V1 encoding. In additon, also other ineger compression algorithm should be evaluated, which are designed to support SIMD instructions/vectorization for decoding the index fragments.
    SIMD instructions are supported in the browser via WebAssembly
    The decoding library should be cross-platform written in Rust which can be compiled to WebAssembly for the usage
    in a browser. In general PMTiles does handle this compression (tile deduplication) use-case really well, so this should be only
    a evaluation of how the compression ratio will improve when using another compression algorithms on the index
    fragment structure on COMTiles. The structure of a COMTiles index fragment differs from an PMTiles directory as
    only the size is stored compared to the additional tile id and offset.

PMTiles Comparison

Hello,

I would be really interested to see a new comparison between PMTiles and COMTiles as I haven't found any recent benchmark.

If anyone has any suggestion as to which one performs better, please let me know. I would really appreciate it.

Thanks!

Best Regards,

Filippos

Reduce the size of the index table

The index table for a planet size vector tileset (z0 - z14) has currently about 3.1 gb in size.
Options to reduce the size:

  • Only one absolute offset per fragment is stored and every index entry holds only the tile size (4 bytes). The client is responsible for resolving the absolute offset for the index entries of a fragment. This can reduce the index size for a planet vector tileset from 3gb to about 1.3gb
  • Compress the index and add an additional fragment table to the archive which references the variable sized index fragments. The full fragment table can be fetched within the initial request

Production Ready?

Hello,

I am really curious if this is production ready, as I would like to use it for my next project along with maplibre-gl-js!

I would love your valuable feedback on this.

Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.