OceanBase Database in Oracle mode provides functions for constructing, querying, calculating, and formatting spatial objects.
Function
The following table describes the functions of the SDO_GEOMETRY type.
| Name | Returns | Description |
|---|---|---|
| GET_DIMS() | NUMBER | Obtains the dimension information of a geometric object. It returns an integer indicating the number of dimensions of the geometric object. The value is defined in SDO_GTYPE. The result is the same as that of the ST_COORDDIM expression. |
| ST_COORDDIM() | NUMBER | Obtains the dimension information of a geometric object. The result is the same as that of GET_DIMS. |
| GET_GTYPE() | NUMBER | Obtains the type code of a geometric object. It returns an integer indicating the type of the geometric object. For example, 2001 indicates a point, 2002 indicates a line, and 2003 indicates a polygon. |
| ST_ISVALID() | NUMBER | Checks the validity of a geometric object. It returns a Boolean value indicating whether the geometric object is valid. TRUE is returned if the geometric object is valid; otherwise, FALSE is returned. |
| GET_WKB() | BLOB | Obtains the Well-Known-Binary (WKB) format of a geometric object. It returns a binary string indicating the WKB format of the geometric object without the SRID. |
| GET_WKT() | CLOB | Obtains the Well-Known-Text (WKT) format of a geometric object. It returns a string indicating the WKT format of the geometric object without the SRID. |
| GET_GEOJSON() | CLOB | Obtains the JSON format of a geometric object. It returns a string indicating the JSON format of the geometric object. The JSON format output of the spatial object is returned. |
The following table describes the functions of the SDO_GEOM package.
| Name | Returns | Description |
|---|---|---|
| SDO_DISTANCE() | NUMBER | Calculates the distance between two geometric objects. It returns an integer indicating the minimum distance between the two geometric objects. |
The following table describes other spatial functions.
| Name | Returns | Description |
|---|---|---|
| SDO_RELATE() | VARCHAR2 | Determines the spatial relationship between two geometric objects. It returns a string (TRUE or FALSE) indicating whether the two objects meet the specified spatial relationship. |
