【问题标题】:what is the best solution to store a tile cache ? in a file system or a database table?存储切片缓存的最佳解决方案是什么?在文件系统或数据库表中?
【发布时间】:2021-01-06 18:12:25
【问题描述】:

我已经使用 xyz 平铺系统和 geotools 实现了平铺服务器来渲染平铺图像,现在我必须缓存我的平铺图像,这是一个 256*256(总是)大小的 png 图像,我没有使用 geowebcache,因为我认为它不适合特征几何和图层样式可以每天更改的网络制图应用程序,因此我使用 xyz 系统而不是使用 bbox 或 wms 请求,我找到了一篇关于将瓷砖作为 mvt(地图框矢量瓷砖)提供的好文章来自https://medium.com/geolytix/xyz-dynamic-vector-tiles-created-on-the-fly-cached-and-updated-directly-in-postgis-37db33c31450,for 的 postgis 我的情况不是缓存 mvt,而是缓存一个光栅图块,与字节数组相同 例如:

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 表提供切片或直接从文件系统提供。

【问题讨论】:

    标签: server postgis tile


    【解决方案1】:

    我有同样的情况,我认为如果你想更新你的瓷砖 postgis 解决方案(中篇文章)更快更容易。

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

    如果您只想随时更改样式,我建议您使用矢量图块。它的速度要快得多。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-05
      • 2019-07-14
      • 1970-01-01
      • 1970-01-01
      • 2012-10-16
      • 1970-01-01
      • 2010-09-14
      • 2010-11-23
      相关资源
      最近更新 更多