SDO_WITHIN_DISTANCE(p.lineshape, 
                    
                    sdo_geometry(2001,8307,sdo_point_type(e.lng,e.lat,null),null,null),
                    
                     'DISTANCE=500 unit=Meter') ='TRUE'
用这个只可以查询
p.lineshape是道路信息e.lng,e.lat 是坐标点
我是想没信息都显示出来有做过的说下
谢谢了~

解决方案 »

  1.   

    没有走错呀~
    就是
    Oracle 中有矩形函数嘛
    然后都能查询出周边了
    我的意思是没有数据的时候把所以的点都显示出来 查询距某一点某一距离的所有要素(即我们通常说的周边查询)sql:
      
      select t.objectid,t.comp_type,t.datatype,t.comp_name,t.health_lic,t.shape.SDO_POINT.X as x,t.shape.SDO_POINT.Y as y,t.reg_addr,t.bus_addr from t_publicplaces t where 1=1 and substr(t.comp_type,0,2)='01' and sdo_within_distance(t.SHAPE,SDO_GEOMETRY(2001,8307,SDO_POINT_TYPE(116.4,39.9,NULL),
      
      NULL,NULL),‘distance=1500.0 unit=m’)='TRUE'
      
      //其中sdo_within_distance是oracle spatial空间查询 这个函数的具体参数与用法可以到