CREATE TABLE MyGeom
(
id NUMBER,
name VARCHAR2(35),
geom SDO_GEOMETRY
);
插入圆形
INSERT INTO MyGeom VALUES
(
1,
'圆形',
SDO_GEOMETRY
(
2003, -- SDO_GTYPE: D00T. Set to 2002 as it is a 2-dimensional line string
32774, -- SDO_SRID
NULL, -- SDO_POINT_TYPE is null
SDO_ELEM_INFO_ARRAY -- SDO_ELEM_INFO attribute (see Table 4-2 for values)
(
1, -- Offset is 1
1003, -- Element-type is 2 for a LINE STRING
4 -- Interpretation is 1 if line string is connected by straight lines.
),
SDO_ORDINATE_ARRAY -- SDO_ORDINATES attribute
(
111.788889,28.318333,
112.633783,28.315394,
112.291389,27.621667
)
)
);
插入多边形
INSERT INTO MyGeom VALUES
(
2,
'多边形',
SDO_GEOMETRY
(
2003, -- SDO_GTYPE: D00T. Set to 2002 as it is a 2-dimensional line string
32774, -- SDO_SRID
NULL, -- SDO_POINT_TYPE is null
SDO_ELEM_INFO_ARRAY -- SDO_ELEM_INFO attribute (see Table 4-2 for values)
(
1, -- Offset is 1
1003, -- Element-type is 2 for a LINE STRING
1 -- Interpretation is 1 if line string is connected by straight lines.
),
SDO_ORDINATE_ARRAY -- SDO_ORDINATES attribute
(
112.291389,27.621667,
112.633333,26.908333,
112.358333,25.561667,
111.340000,25.276667,
109.316667,26.583333,
109.355833,27.882500,
111.788889,28.318333,
112.291389,27.621667
)
)
);