zoukankan      html  css  js  c++  java
  • Oracle空间分析SQL语句

    点是否在圆内:

    select *

      from table a

     where SQRT(power(a.LONGITUDE - 116.3676095557983, 2) +

                power(a.LATITUDE - 39.913205912837014, 2)) <=

           0.039790863734664776

    点是否在多边形内:

    select *

              from table a,

             (select MDSYS.SDO_GEOMETRY(2003,

                                        NULL,

                                        NULL,

                                        MDSYS.SDO_ELEM_INFO_ARRAY(1,

                                                                  1003,

                                                                  1),

                                        MDSYS.SDO_ORDINATE_ARRAY(116.32538033694757,

                                                                 39.906350079429856,

                                                                 116.33095311487795,

                                                                 39.87091007279355,

                                                                 116.39480688269283,

                                                                 39.85758832979095,

                                                                 116.4214463155306,

                                                                 39.89240348162625,

                                                                 116.3783335525407,

                                                                 39.9799055395663,

                                                                 116.28691483413509,

                                                                 39.97172243440462,

                                                                 116.28958264221046,

                                                                 39.919422096307414,

                                                                 116.33388775596742,

                                                                 39.92787481642996,

                                                                 116.33047452402171,

                                                                 39.92786278190348,

                                                                 116.29558151638385,

                                                                 39.90043630083025,

                                                                 116.32538033694757,

                                                                 39.906350079429856)) as geom

                from dual) c

             where a.LONGITUDE > 0

               and a.LATITUDE > 0

               and (1 = 2 or sdo_Geom.Relate(c.geom,

                                             'Anyinteract',

                                             mdsys.sdo_geometry(2001,

                                                                null,

                                                                mdsys.sdo_point_type(a.LONGITUDE,

                                                                                     a.LATITUDE,

                                                                                     null),

                                                                null,

                                                                null),

                                             0.000001) = 'TRUE')

  • 相关阅读:
    form编码方式application/x-www-form-urlencoded和multipart/form-data的区别
    CentOS开启telnet服务
    借助英语搞清会计中“借”/“贷”的含义(转载)
    乘法器的Verilog HDL实现(转载)
    Meth | 关闭mac自带apache的启动
    Meth | Git冲突:commit your changes or stash them before you can merge. 解决办法
    Meth | Git 避免重复输入用户名和密码方法
    Meth | git Please move or remove them before you can merge
    Meth | git 常用命令
    Meth | 小团队git开发模式
  • 原文地址:https://www.cnblogs.com/whisht/p/2251819.html
Copyright © 2011-2022 走看看