91名师指路-头部
91名师指路

ERROR: lwgeom_difference: GEOS Error: TopologyException: Input geom 0 is invalid: Too few points in

由于某些原因,现在不支持支付宝支付,如需要购买源码请加博主微信进行购买,微信号:13248254750

一:postgresql 使用 ST_Difference 报错信息如下:

ERROR:  lwgeom_difference: GEOS Error: TopologyException: Input geom 0 is invalid: Too few points in geometry component at or near point 120.125613752384 31.665662179977399 at 120.125613752384

二:我的sql 如下:

select ST_Difference(
(
select geom from table where id=1 -- sqlA
),
(
select geom from table where id=2 -- sqlB
)
) as boundar

单独运行 sqlA和sqlB都是正确的,执行整段sql后报错。


三:解决办法,加上ST_buffer,完整的sql如下:

select ST_Difference(
(
select ST_buffer(geom, -0.00) from table where id=1 -- sqlA
),
(
select ST_buffer(geom, -0.00) from table where id=2 -- sqlB
)
) as boundar



2021-06-24 17:15:11     阅读(1790)

名师出品,必属精品    https://www.91mszl.com

联系博主    
用户登录遮罩层
x

账号登录

91名师指路-底部