SQL如何取得一个面的中心点
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
select sdo_geom.sdo_centroid(t.shape, 2) .sdo_point.x x, sdo_geom.sdo_centroid(t.shape, 2) .sdo_point.y y from gd_zy_region t
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 SELECT MAX(SUBSTR(N.COOR, 2, LENGTH(N.COOR))) AS COOR 2 FROM (select curr, SYS_CONNECT_BY_PATH(coor, ';') AS COOR, prev 3 from (select rownum as curr, 4 m.COLUMN_VALUE as coor, 5 rownum - 1 as prev 6 from table (select t.SHAPE.sdo_ordinates as c 7 from dmgc_GX t 8 where t.OBJECTID = 11) m) 9 start with curr = 1 10 connect by prev = PRIOR curr) N
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 select replace(wm_concat(m.COLUMN_VALUE), ',', ';') as coor from table (select t.SHAPE.sdo_ordinates as c from " + strFileName + " t where t.OBJECTID = " + objectid + ") m
//存储过程 循环遍历将空间坐标转化为属性数据
create or replace procedure insertxy is
cursor var_ids is
select objectid var_objid from DM_ZK;
var_objid varchar2(35);
begin
for vc in var_ids loop
insert into DM_ZK_TEMP
(ZB)
select replace(wm_concat(m.COLUMN_VALUE), ',', ';') as coor
from table (select t.SHAPE.sdo_ordinates as c
from DM_ZK t
where t.OBJECTID = vc.var_objid) m;
end loop;
end insertxy;
得即高歌失即休,多愁多恨亦悠悠。今朝有酒今朝醉,明日愁来明日愁