Time Slider for Mapbox Vector Tiles: Separate SQLite Files or a Single Combined File?

47 views Asked by At

I'm creating a series of Mapbox Vector Tiles (which are just SQLite databases) for my web app. These tiles will represent a frame in time and I will have many frames over hundreds of hours that the user will visualize via a time slider. Would it be best to keep the MVTs separate, or keep my current implementation which is joining with Tippecanoes tile-join these separate MVTs into one file, accessing the different frames as layers? Merging them into one MVT works nice overall but they get quite large and slow to process after a while since it has to be read into RAM. Keeping them seperate would fix this problem but I worry that the rapid connecting/disconnecting from the SQLite files when scrolling through time would create some performance issues. Thanks for any help and advice!

1

There are 1 answers

0
Steve Bennett On

Let's say you have one data value (temp, temperature), at different times (h, hour).

You essentially have 3 choices, not 2:

  1. One mbtiles file per hour. Each contains one layer (temps), with 1 temp value per geometry.
  2. One mbtiles file, with one layer per hour (temp1, temp2...), with one temp value per geometry.
  3. One mbtiles file, with one layer (temps), with multiple temp values per geometry (temp1, temp2...)

Personally I would:

  1. Start with option 3.
  2. If each tile is too big (for the zoom levels you want), try option 2.
  3. If you ran into performance issues at the server end because each file was so huge, try option 1. That seems pretty unlikely to me - I've never run into a situation like that.

but they get quite large and slow to process after a while since it has to be read into RAM.

I'm not sure what you meant by "it" here, or whether you are talking about the tile generation process (once-off) or the serving process, or what's happening in the browser. Generating tiles can be slow, but you don't have to do it very often.