postgres12.0+postgis3.0以上版本
1.传入参数
layerName表名
zoom 级别
row 行号
col 列号
2.sql源码
SELECT
ST_AsMVT (tile,#{layerName},4096,'geom') tile
FROM
(
SELECT
st_asmvtgeom (geom,
ST_TileEnvelope(${zoom}, ${
row}, ${col},st_makeenvelope (-180,-270,180,90, 4326)),
4096,
0,
TRUE
) AS geom
<if test="cols != null and cols != ''">
,${cols}
</if>
FROM
${layerName}
) AS tile
WHERE
tile.geom IS NOT NULL;
3.调用
List<Map

文章讲述了在Postgres12.0及以上版本(搭配PostGIS3.0)中使用SQL生成MVT瓦片的过程,包括参数、数据转换和函数,以及不同版本间的差异和调用方法。
最低0.47元/天 解锁文章
2205





