The Oracle mode of OceanBase Database provides some functions for the construction, query, calculation, and format conversion of spatial objects.
Function list
The following table describes the member functions of the SDO_GEOMETRY type.
| Function | Return type | Description |
|---|---|---|
| GET_DIMS() | NUMBER | Obtains the dimension information of a geometry object. It returns an integer that represents the number of dimensions of the geometry object, as defined in the SDO_GTYPE attribute. The value returned is the same as that returned by ST_COORDDIM(). |
| ST_COORDDIM() | NUMBER | Same as GET_DIMS(). |
| GET_GTYPE() | NUMBER | Obtains the type code of a geometry object. It returns an integer that represents the type of the geometry object. For example, 2001 represents a point, 2002 represents a line, and 2003 represents a polygon. |
| ST_ISVALID() | NUMBER | Tests the validity of a geometry object. It returns a Boolean value that indicates whether the geometry object is valid. If the geometry object is valid, TRUE is returned. If not, FALSE is returned. |
| GET_WKB() | BLOB | Obtains the well-known binary (WKB) representation of a geometry object. It returns a binary string that represents the geometry object in the WKB format, without the spatial reference identifier (SRID). |
| GET_WKT() | CLOB | Obtains the well-known text (WKT) representation of a geometry object. It returns a string that represents the geometry object in the WKT format, without the SRID. |
| GET_GEOJSON() | CLOB | Obtains the JSON representation of a geometry object. It returns a string that represents the geometry object in the JSON format. |
The following table describes the member functions of SDO_GEOMETRY.
| Function | Return type | Description |
|---|---|---|
| SDO_DISTANCE() | NUMBER | Calculates the distance between two geometry objects. It returns an integer that represents the distance between the geometry objects. |
The following table describes other spatial functions.
| Function | Return type | Description |
|---|---|---|
| SDO_RELATE() | VARCHAR2 | Verifies the spatial relationship between two geometry objects. It returns TRUE or FALSE to indicate whether the two geometry objects are of the specified spatial relationship. |