李克华 发表于 2012-12-10 14:49:26

Oracle spatial 周边查询SQL

Oracle spatial 周边查询SQL

<div class="postbody"><div id="cnblogs_post_body">查询距某一点某一距离的所有要素(即我们通常说的周边查询)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是oraclespatial空间查询   这个函数的具体参数与用法可以到oracle官网上去搜索
页: [1]
查看完整版本: Oracle spatial 周边查询SQL