st_split::= ST_SPLIT "(" input "," blade ")"Copied!
ST_SPLIT函数用于返回input几何对象被blade几何对象切割之后产生的几何对象。
本函数遵守如下规则:
input
通用表达式,其值必须为有效的ST_GEOMETRY类型的数据。
blade
通用表达式,其值必须为有效的ST_GEOMETRY类型的数据。
示例
SELECT st_astext(st_split(st_geomfromtext('linestring(1 1, 3 3)'), st_geomfromtext('point(2 2)')), 0) split FROM dual;
SPLIT
----------------------------------------------------------------
GEOMETRYCOLLECTION (LINESTRING (1 1, 2 2), LINESTRING (2 2, 3 3))
SELECT st_astext(st_split(st_geomfromtext('linestring(1 1, 4 4)'), st_geomfromtext('multipoint(2 2, 3 3)')), 0) split FROM dual;
SPLIT
----------------------------------------------------------------
GEOMETRYCOLLECTION (LINESTRING (3 3, 4 4), LINESTRING (1 1, 2 2), LINESTRING (2 2, 3 3))
SELECT st_astext(st_split(st_geomfromtext('linestring(1 1, 4 4)'), st_geomfromtext('polygon((0 0, 0 2, 2 2, 2 0, 0 0))')), 0) split FROM dual;
SPLIT
----------------------------------------------------------------
GEOMETRYCOLLECTION (LINESTRING (1 1, 2 2), LINESTRING (2 2, 4 4))
SELECT st_astext(st_split(st_geomfromtext('polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), st_geomfromtext('linestring(1 -1, 1 3)')), 0) split FROM dual;
SPLIT
----------------------------------------------------------------
GEOMETRYCOLLECTION (POLYGON ((0 0, 0 2, 1 2, 1 0, 0 0)), POLYGON ((1 2, 2 2, 2 0, 1 0, 1 2)))
SELECT st_astext(st_split(st_geomfromtext('geometrycollection(polygon((0 0, 0 2, 2 2, 2 0, 0 0)), linestring(0 0, 2 2))'), st_geomfromtext('linestring(1 -1, 1 3)')), 0) split FROM dual;
SPLIT
----------------------------------------------------------------
GEOMETRYCOLLECTION (POLYGON ((0 0, 0 2, 1 2, 1 0, 0 0)), POLYGON ((1 2, 2 2, 2 0, 1 0, 1 2)), LINESTRING (0 0, 1 1), LINESTRING (1 1, 2 2))原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。