meta-data of a space table
Take all objects of the table's Sdo_geometry column as a layer of space. Spatial needs to validate, create indexes, and query all space objects. You need to specify the appropriate metadata for the layer, which contains the following information: dimension, dimension boundary, tolerance, coordinate system. The above information for each layer is populated in the User_sdo_geom_metadata dictionary attempt.
Sql>describe User_sdo_geom_metadata
User_sdo_geom_metadata View |
Column Name |
Type |
Column Name Description |
table_name |
VARCHAR2 () |
|
column_name |
VARCHAR2 () |
|
SRID |
Number |
|
Diminfo |
Mdsys. Sdo_dim_array |
Wei-degree information |
|
|
|
Srid Property: Srid is the space Reference System ID. If Sdo_srid is null, the coordinate system is not specified, and if Sdo_srid is not NULL, its value must have a corresponding value in the SRID column in the Mdsys.cs_srs table.
Mdsys.cs_srs table |
Column Name |
Type |
Column Name Description |
Cs_name |
VARCHAR2 (68) |
Coordinate system name |
SRID |
Number (38) |
Space reference ID, a unique value. 1-999999 spatial reference for spatial use, 1000000 later for user customization |
Auth_srid |
Number (38) |
Optional Srid, is a foreign key. Srid of another coordinate system |
Dimeinfo Properties:
Sql>describe Sdo_dim_array
The data type of the property is Mdsys.sdo_dim_array it is an array of variable-length sdo_dim_element types. The size is determined by the dimension, and for a two-dimensional geometry, the package line is two sdo_dim_element.
Sdo_dim_element contains the following properties:
Sdo_dimname represents the name of the dimension, such as X,y
The upper and lower bounds of the sdo_lb and sdo_ub dimensions, such as longitude sdo_lb-180 Sdo_ub 180. Wei degree longitude sdo_lb-90 sdo_ub 90.
Sdo_tolerance, tolerance values, such as a and b two points by 0.5, are considered the same position.
sdo_geometry Data Types Define your own object types with arrays, structs, or classes with constructors and functional functions. Such an object type can be used for the data type of the property column, or it can be used to create the object table.
Oracle spatial is also a set of spatial data processing systems developed on the basis of this feature.
Spatial has a number of custom data types, all under the Mdsys scheme, often using the sdo_geometry type.
Sdo_geometry represents a geometric object that can be a point, line, surface, multi point, multi-line, faceted, or mixed object.
Spatial index of R-Tree and four-fork tree Spatial index are realized based on this data type, and many spatial analysis functions are realized in the form of SQL function.
The GEOLOC definition structure is as follows:
CREATE TYPE Sdo_geometry as OBJECT (
Sdo_gtype number,
Sdo_srid number,
Sdo_point Sdo_point_type,
Sdo_elem_info Mdsys. Sdo_elem_info_array,
Sdo_ordinates Mdsys. Sdo_ordinate_array);
)
(1), Sdo_gtype: all shapes are defined with four digits
Number one: Dimensions such as two-dimensional, three-dimensional corresponding 2 and 3
Second: Defines the LRS. is generally 0;
Last two bits: Defines the type of the geographic object. Now use from 00 to 07
Value Geometry Description
Unknown_geometry Spatial ignores this value
Point A Single Point element
The line or CURVE Contains a one line string element is linear, curved or both
POLYGON Contains one POLYGON element with or without the other POLYGON elements in it
COLLECTION A heterogeneous COLLECTION of elements
Multipoint Contains one or more points
MULTILINE or Multicurve Contains one or more line string elements
Modified Multipolygon Contains Multiple polygon elements that maybe disjoint
Like the sdo_gtype:2002 of a line.
(2), Sdo_srid: defines the space coordinate reference system. Null is the Cartesian coordinate system.
If Sdo_srid is null and no coordinate system is associated with the geometry.
If Sdo_srid is isn't null, it must contain a value from SRID column of the Sdo_coord_ref_sys table,
And this value must is inserted into the SRID column of the User_sdo_geom_metadata view.
All geometries in a geometry column must have the same Sdo_srid value.
(3), Sdo_point: Oracle spatial can also define a single point, sdo_point definition:
CREATE TYPE Sdo_point_type as OBJECT (X number,y number,z number); If it is two-dimensional, Z is null.
If the geometry type is a point type, the corresponding value for Sdo_elem_info and sdo_ordinates is null,sdo_point not null. In other cases, Sdo_point is set to null by spatial. If this layer has only a point object, then it is recommended that you save it in the Sdo_point attribute.
(3), Sdo_elem_info: defines how to understand the coordinate string properties in Sdo_ordinates.
First Number: Sdo_starting_offset
Second number: Sdo_etype
Third: Sdo_interpretation
A, sdo_starting_ OFFSET: Declares the coordinate ordinal of the first coordinate that makes up the current geometry fragment in the sdo_ordinates array. The
coordinate sequence number starts at 1 rather than starting at 0. The sdo_ordinates here is the coordinate sequence in Sdo_geometry, where the
coordinate sequence is a comma-separated number, calculated as: Sdo_ordinate_array (1,4,6,7,8,9) If the geometry fragment starts with ' 6 ', the
coordinate number sdo_starting_offset=3.
B, Sdo_etype: Declares the type of an element. Can be combined with sdo_starting_offset and Sdo_etype table to understand.
C, Sdo_interpretation: Can be understood in conjunction with Sdo_starting_offset and Sdo_etype tables.
Sdo_etype |
Sdo_interpretation
|
Combination meaning |
1 |
Any number (n) |
No |
1 |
1 |
Ordinary single point |
1 |
N |
More points |
2 |
1 |
The Polysemy line composed of straight line segments |
2 |
2 |
The polysemy line composed of curved segments |
1003 or 2003. |
1 |
A polygon consisting of a series of straight segments |
1003 or 2003. |
2 |
A polygon consisting of a series of curved segments |
1003 or 2003. |
3 |
Rectangular |
1003 or 2003. |
4 |
Round |
4 |
N (n>1) |
Complex multi-semantic lines composed of straight segments and curved segments |
1005 or 2005. |
N (n>1) |
A complex polygon composed of straight segments and curved segments |
Description
The Sdo_etype value = 1, 2, 1003, or 2003, indicating that geometry is a simple geometric type. You can all use the Sdo_elem_info property unit [that is, three comma-separated numbers] to understand the sequence of coordinates in Sdo_ordinate_array.
Sdo_etype value = 1003, if the geometry type is face, then the outer polygon ring (in counter-clockwise order)
Sdo_etype value = 2003, if the geometry type is face, it is represented as an inner polygon ring (in clockwise order)
The Sdo_etype value = 4,1005 or 2005, which indicates that geometry is a composite element, and that the first three digit group is not a Sdo_elem_info property unit, but rather to describe the information of the composite element.
sdo_ordinates: A list of all vertices of the geometry. is defined as the CREATE TYPE Sdo_ordinate_array as Varray (1048576) of number;
The sdo_ordinates attribute is defined using a varying length array (1048576) of number type
That stores the coordinate values which make the boundary of a spatial object. For example, construct a straight line a,b line, where a point coordinates x0,y0. b coordinate x1,y1, the order of sdo_ordinates storage is x0,y0,x1,y1.
Reference to: