码迷,mamicode.com
首页 > Windows程序 > 详细

c#读写SDO_GEOMETRY字段

时间:2018-04-17 11:38:24      阅读:595      评论:0      收藏:0      [点我收藏+]

标签:查询   div   nbsp   ddr   class   span   inf   distance   查询语句   

查询语句

select 
   t.SHAPE.SDO_gtype as SDO_gtype,
   t.shape.sdo_srid as sdo_srid,
   t.shape.sdo_point.x as point_x,
   t.shape.sdo_point.y as point_y,
   t.shape.sdo_point.z as point_z,
   t.shape.sdo_elem_info as elem_info,
   t.shape.sdo_ordinates as sdo_ordinates
from T_table t

插入字段值

INSERT INTO T_table (ID,SHAPE) VALUES(
          10000000003,         
          MDSYS.SDO_GEOMETRY( 
                      2003,
                      NULL,
                      NULL,
                      MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3,3,22),
                      MDSYS.SDO_ORDINATE_ARRAY(1,1, 5,7)

         )
 );

读取字段

select t.id as region_id, sdo_util.to_gmlgeometry(t.shape) as region_location from T_table t

 获取类型

select t.shape.get_gtype() from T_table t

select t.SHAPE.SDO_gtype from T_table t

 条件查询

select t.objectid,
       TO_CHAR(t.shape.get_wkt()) AS wkt,
       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

 

c#读写SDO_GEOMETRY字段

标签:查询   div   nbsp   ddr   class   span   inf   distance   查询语句   

原文地址:https://www.cnblogs.com/lee24789229/p/8861714.html

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