码迷,mamicode.com
首页 > 数据库 > 详细

oracle spatial创建空间表、元数据

时间:2019-12-25 20:21:50      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:The   arch   nat   spatial   ide   ons   varchar   tab   gty   

这样就能在idesktop中看到数据源了。

CREATE TABLE us_restaurants_new
(
id NUMBER,
poi_name VARCHAR2(32),
location MDSYS.SDO_GEOMETRY -- New column to store locations
);

--插入元数据
insert into user_sdo_geom_metadata(TABLE_NAME,COLUMN_NAME
,DIMINFO,SRID) values(
‘us_restaurants_new‘,
‘location‘,
mdsys.sdo_dim_array(
MDSYS.SDO_DIM_ELEMENT(‘x‘,70.000000000,140.000000000,0.000000050),
MDSYS.SDO_DIM_ELEMENT(‘y‘,0.000000000,60.000000000,0.000000050)),
8307--SRID
);

 

INSERT INTO us_restaurants_new VALUES
(
1,
‘PIZZA HUT‘,
SDO_GEOMETRY
(
2001, -- SDO_GTYPE attribute: "2" in 2001 specifies dimensionality is 2.
NULL, -- other fields are set to NULL.
SDO_POINT_TYPE -- Specifies the coordinates of the point
(
-87, -- first ordinate, i.e., value in longitude dimension
-78, -- second ordinate, i.e., value in latitude dimension
NULL -- third ordinate, if any
),
NULL,
NULL
)
);

oracle spatial创建空间表、元数据

标签:The   arch   nat   spatial   ide   ons   varchar   tab   gty   

原文地址:https://www.cnblogs.com/yansc/p/12098561.html

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