如何计算重叠区域 - postgis,postgres?

时间:2018-06-05 15:32:23

标签: postgresql postgis overlap area

如何计算重叠区域?

select ST_Area(ST_Overlaps(geometrya, geometryb)::geometry) from table_name;

错误消息无法将类型布尔值转换为几何

1 个答案:

答案 0 :(得分:1)

ST_OVERLAPS返回一个布尔值,指示几何是否相互重叠。要获得交叉点的几何图形,可以使用ST_INTERSECTION

select ST_Area(ST_INTERSECTION(geometrya, geometryb)) from table_name
 WHERE ST_Overlaps(geometrya, geometryb);