You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何提取多边形外部线段?PostGIS线段切割问题求助

问题描述

需要基于多边形对线段进行切割,仅保留位于多边形外部的切割后线段,且切割必须在交点处完成。目前执行的SQL未达到预期效果,线段未在交点处正确切割。

现用SQL代码

select ST_SymDifference(ci.wkb_geometry,di.wkb_geometry )
from
(select st_union(ST_MakeValid(wkb_geometry)) as wkb_geometry from line) as ci
,
(
SELECT st_union(ST_MakeValid(ST_intersection(l.wkb_geometry, p.wkb_geometry))) as wkb_geometry
FROM line l, polygon p where ST_intersects(l.wkb_geometry, p.wkb_geometry)
) as di

图示

  • 示例场景:示例场景
  • 当前错误结果:当前错误结果

内容的提问来源于stack exchange,提问作者Bak

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 09:49:56