存储切片缓存的最佳解决方案是什么?在文件系统或数据库中 table?

what is the best solution to store a tile cache ? in a file system or a database table?

我已经使用 xyz tile 系统和 geotools 实现了一个 tile 服务器来渲染 tile 图像,现在我必须缓存我的 tile 图像,它是一个 png 图像 256*256(always) 大小,我没有使用 geowebcache因为我认为它不是 suitable 对于网络制图应用程序,其中特征几何和图层样式可以每天更改,所以我使用 xyz 系统而不是使用 bbox 或 wms 请求,我找到了一篇关于服务瓷砖的好文章来自 https://medium.com/geolytix/xyz-dynamic-vector-tiles-created-on-the-fly-cached-and-updated-directly-in-postgis-37db33c31450,for postgis 的 mvt(mapbox 矢量切片)我的情况不是缓存 mvt,而是缓存栅格切片,与 bytearray 相同 例如:

create table if not exists tile_cache
(
    z integer not null,
    x integer not null,
    y integer not null,
    mvt tile,
    bbox geometry(Polygon,4326),
    constraint tile_cache_x_y_pk
        primary key (z, x, y)
)
;

create index if not exists tile_cache_z_x_y_idx
    on tile_cache (z, x, y)
;

它将创建一个 xyz 索引来加速思考, 所以我想知道最好和更快的解决方案是什么? 使用 xyz 索引或直接从文件系统提供来自 postgis table 的切片。

我有同样的情况,我想如果你想更新你的 tiles postgis 解决方案(medium article)会更快更容易。

但如果您只想将栅格图块作为静态地图读取,文件系统解决方案要快得多,并且您可以使用 {z(directory)}/{x(directory)}/{y(tile)} 等结构保存数据 我建议看看 tippecanoe 项目。这是静态地图的完美方式,甚至比文件系统解决方案更好。

如果您只想随时更改样式,我建议您使用矢量图块。快多了。