mysql sdo geometry_c#读写SDO_GEOMETRY字段

查询语句

selectdb.SHAPE.SDO_gtypeasSDO_gtype,db.shape.sdo_sridassdo_srid,db.shape.sdo_point.xaspoint_x,db.shape.sdo_point.yaspoint_y,db.shape.sdo_point.zaspoint_z,db.shape.sdo_elem_infoaselem_info,db.shape.sdo_ordinatesassdo_ordinatesfrom T_table db

regexp_replace(sdo_util.to_gmlgeometry(db.shape),'?[^>]*>|nbsp;|&','') as ORDINATES

插入字段值

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 db.id as region_id, sdo_util.to_gmlgeometry(db.shape) as region_location from T_table db

获取类型

select db.shape.get_gtype() fromT_tabledbselect db.SHAPE.SDO_gtype from T_table db

条件查询

selectdb.objectid,

TO_CHAR(db.shape.get_wkt()) AS wkt,db.comp_type,db.datatype,db.comp_name,db.health_lic,db.shape.SDO_POINT.Xasx,db.shape. SDO_POINT.Yasy,db.reg_addr,db.bus_addrfromt_publicplacesdbwhere 1 = 1and substr(db.comp_type,0, 2) = '01'and sdo_within_distance(db.SHAPE,

SDO_GEOMETRY(2001,8307,

SDO_POINT_TYPE(116.4, 39.9, NULL),

NULL,

NULL),'distance=1500.0 unit=m') = 'TRUE'

SELECT

/*轨迹SHAPE信息 */

db.id,

db.SHAPE.SDO_gtype as SDO_gtype,

db.shape.sdo_srid as sdo_srid,

db.shape.sdo_point.x as point_x,

db.shape.sdo_point.y as point_y,

db.shape.sdo_point.z as point_z,

'' as elem_info,

/*

db.shape.sdo_elem_info as elem_info,

db.shape.sdo_ordinates as sdo_ordinates,

sdo_util.to_gmlgeometry(db.shape) as sdo_ordinates

*/

regexp_replace(sdo_util.to_gmlgeometry(db.shape),'?[^>]*>|nbsp;|&','') as ORDINATES

FROM T_DEVICESTRACK db;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值