postgis向量瓦片幾個函式理解
阿新 • • 發佈:2021-11-25
- 一個完整例項
with mvtgeom as( select st_asmvtgeom( geom, lsy_bboxxuz4490(218453,43497,18), --st_tileenvelope(18,218453,43496), 4096, 256, false ) as geom, idfrom yh_map_supplypipe where st_Intersects( geom, sy_bboxxuz4490(218453,43497,18), ) ) select st_asmvt(mvtgeom.*) from mvtgeom;
解析1:geometryST_AsMVTGeom(
geometrygeom, box2dbounds
)
;
把空間資料按照瓦片座標方式進行座標重新編排,在lsy_bboxxuz4490(218453,43497,18)裡面的都是 0-4096,超出的有負數有更大的數
解析2:ST_AsMVT聚合函式用於將基於MapBox VectorTile座標空間的幾何圖形轉換為MapBox VectorTile二進位制向量切片