首页 > 其他分享 >postgre 的ST_Intersection 求面的交集

postgre 的ST_Intersection 求面的交集

时间:2023-02-15 15:13:16浏览次数:30  
标签:西城区 name 求面 postgre geom sql Intersection select

一开始是给了一坨 面的数据

 

需要将面按照街镇 进行分割

 

我想的是改库表  对geometry数据进行处理  

 

后面发现了st_intersection 这个函数  求两个面的交集  

就不用对表进行处理了  只要sql查询就可以了

 

大概sql

select  province_name, city_name, county_name, hazard_class,  color, ST_Intersection(geom, (select geom from nanhaiqu_polygon where name = '西城区')) as geom from dw_p_10_440605_01

where st_intersects(geom, (select geom from nanhaiqu_polygon where name = '西城区')) != 'f'

sql的大概意思是 找给一个北京市的geom数据  和 西城区的geom   找出北京市那张表中位于西城区 且不为空 的数据 

 

标签:西城区,name,求面,postgre,geom,sql,Intersection,select
From: https://www.cnblogs.com/bawanglong168/p/17123103.html

相关文章