OceanBase Database in Oracle mode provides some member functions of the SDO_GEOMETRY data type for the construction, query, and format conversion of spatial objects.
The following table describes the member functions of SDO_GEOMETRY.
| Name | Returns | 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 binary 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. |