t-rex-tileserver / t-rex

t-rex is a vector tile server specialized on publishing MVT tiles from your own data
https://t-rex.tileserver.ch/
MIT License
545 stars 68 forks source link

Is there a way to drop old tiles where geometry is not present anymore? #270

Closed dmitrykinakh closed 2 years ago

dmitrykinakh commented 2 years ago

Hi there, I have the following case.

  1. Let's imagine I've tiled the boundary of every county in the world.
  2. After a while, I've removed geometry data for the capital of Ukraine, Kyiv from DB.
  3. From the Trex perspective, as far, as I for, no geometry - no requests to generate something for that area.
  4. So, after regenerating tiles I might face the case, that on some zoom levels, (I think 0-10 or something like that), the shape of Kyiv will be not present as other capitals might be included in a single PBF file due to zoom, level. However, as soon as the area where Kyiv was located will be only the item that was in PBF - Trex will skip regeneration of those PBFs as no need to regenerate if there is no data in DB.

Please see the video of the case I'm referring to - https://monosnap.com/file/4gAoODHAVFbu2X7sPzha0IQk5snA85

Is there any other option (except add an extra flag in DB for those records (like deleted = 1) and then exclude records with that status from map view?

pka commented 2 years ago

There is the --overwrite flag in t_rex generate, but as you mention, empty tiles are not generated as files. There seems actually a need for an explicit delete operation. The only way for now is to delete genereted tiles manually and regenerate the cache.

dmitrykinakh commented 2 years ago

This issue was resolved in https://github.com/t-rex-tileserver/t-rex/pull/276 Closing.