SELECT
st_geomfromtext
(
'POINT('
||
x
||
' '
||
y
||
')'
,
4326
)
AS
geohazard_point_geom
,
risk_level
geohazard_all_english
WHERE
risk_level
IN
(
'较高'
,
'高'
)
)
bb
,
(
SELECT
geom
FROM
department_info
WHERE
ID
=
'管道'
)
cc
WHERE
ST_Covers
(
cc
.
geom
,
bb
.
geohazard_point_geom
)
=
't'
SELECT
COUNT ( * ),'自定义数据' as title
SELECT
st_geomfromtext ( 'POINT(' || x || ' ' || y || ')', 4326 ) AS geohazard_point_geom,
risk_level
geohazard_all_english
WHERE
risk_level IN ('较高', '高' )
) bb,
( SELECT geom FROM department_info WHERE ID = '管道' ) cc
WHERE
ST_Covers ( cc.geom, bb.geohazard_point_geom ) = 't'
查询结果: