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

how to calculate the overlap area - postgis, postgres?

如何计算重叠面积?

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

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

ST_OVERLAPS returns a boolean indicating if the geometries do or not overlap each other. To get the geometry of the intersection you can use ST_INTERSECTION

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