1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
SELECT
st_asmvt (geom) AS mvt
FROM
(
SELECT
st_asmvtgeom (
geom,
st_transform (
st_tileenvelope (
#{z}, #{x}, #{y}
),
4326
),
4096,
0,
FALSE
),
crop_code AS NAME
FROM
field
WHERE
geom is not null
-- 只获取对应tile范围内的几何,避免不必要的性能损失
and ST_Intersects(
geom,
st_transform (
st_tileenvelope (
#{z}, #{x}, #{y}
),
4326
)
)
) AS geom
|
Preview: