St_disjoint(geom A,geom B)返回A是否不在B中
St_union(geom A,geom B)返回A+B两个几何的合并
ST_Collect(geom A,geom B)返回A+B两个几何的聚合
St_intersects(geom A,geom B)返回A是否和B有接触
St_intersection(geom A,geom B)返回A和B的交集
St_within(geom A,geom B)返回A是否处于B中
St_difference(geom A,geom B)返回A与B不相交的部分几何
A B 图作为测试图形,用来验证这些函数的使用
-- A 图
select ST_GeomFromGeoJSON('{"type":"Polygon","coordinates":[[[120.52757263183594,31.495432803134843],[120.59211730957031,31.31199502365151],[120.89012145996094,31.35950051982242],[120.74729919466666,31.483245492650792],[120.52757263183594,31.495432803134843]]]}')
-- B 图
select ST_GeomFromGeoJSON('{"type":"Polygon","coordinates":[[[120.74386596679688,31.487235582017444],[120.84548950195312,31.269747790889888],[121.01783752441405,31.378261512889125],[120.91827392578125,31.487821121636433],[120.74386596679688,31.487235582017444]]]}')
A图:
B图:
=========================== St_union和ST_