码迷,mamicode.com
首页 > 其他好文 > 详细

SDO_RELATE和SDO_GEOM.RELATE

时间:2019-05-14 11:10:24      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:exp   section   eterm   regexp   HERE   inf   The   function   mamicode   

SDO_RELATE需要事先建立索引,而SDO_GEOM.RELATE不用。

SDO_RELATE返回True或False,

SDO_GEOM.RELATE除可返回True或False外,还可返回关系(当mask设为‘determine‘时)。

    select z.id1,z.id2,
    SDO_RELATE (s1.geom, s2.geom,‘mask=TOUCH+OVERLAPBDYDISJOINT+OVERLAPBDYINTERSECT‘) sdo_relate,
            SDO_GEOM.RELATE(s1.geom,‘determine‘,s2.geom,0.5) relation,
            to_char(regexp_replace(sdo_util.to_gmlgeometry(z.intsxn_geom),‘</?[^>]*>|nbsp;|&‘,‘‘)) zc,
            to_char(regexp_replace(sdo_util.to_gmlgeometry(s1.geom),‘</?[^>]*>|nbsp;|&‘,‘‘)) sc1,
            to_char(regexp_replace(sdo_util.to_gmlgeometry(s2.geom),‘</?[^>]*>|nbsp;|&‘,‘‘)) sc2
            from SALES_INTERSECTION_ZONES z, sales_regions s1,sales_regions s2
            where z.id1=s1.id
            and z.id2=s2.id

技术图片

-- Listing 9-15. RELATE Function Complementing the SDO_RELATE Operator
SELECT sra.id,
SDO_GEOM.RELATE(sra.geom, ‘DETERMINE‘, srb.geom, 0.5) relationship
FROM sales_regions srb, sales_regions sra
WHERE srb.id=51
AND sra.id<>51
AND SDO_RELATE (
  sra.geom, srb.geom,
 ‘mask=TOUCH+OVERLAPBDYDISJOINT+OVERLAPBDYINTERSECT‘
) = ‘TRUE‘
ORDER BY sra.id;

 

SDO_RELATE和SDO_GEOM.RELATE

标签:exp   section   eterm   regexp   HERE   inf   The   function   mamicode   

原文地址:https://www.cnblogs.com/mol1995/p/10860907.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!