This is an automated email from the ASF dual-hosted git repository.
zclll pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new 66aa3867386 [feature](spatial function) support docs for st_distance,
st_geometrytype and st_length (#3302)
66aa3867386 is described below
commit 66aa3867386ac9a1092f4b2c4572b8abba337d8e
Author: Xichun Zhao <[email protected]>
AuthorDate: Fri Feb 13 21:06:48 2026 +0800
[feature](spatial function) support docs for st_distance, st_geometrytype
and st_length (#3302)
…type and st_length
add 3 new GIS functions' doc:
* `ST_Distance`
* `ST_Length`
* `ST_GeometryType`
## Versions
- [x] dev
- [x] 4.x
- [ ] 3.x
- [ ] 2.1
## Languages
- [x] Chinese
- [x] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
---
.../scalar-functions/spatial-functions/st-angle.md | 2 +-
.../spatial-functions/st-distance.md | 108 +++++++++++++++++
.../spatial-functions/st-geometrytype.md | 111 +++++++++++++++++
.../spatial-functions/st-length.md | 127 ++++++++++++++++++++
.../scalar-functions/spatial-functions/st-angle.md | 2 +-
.../spatial-functions/st-distance.md | 108 +++++++++++++++++
.../spatial-functions/st-geometrytype.md | 111 +++++++++++++++++
.../spatial-functions/st-length.md | 127 ++++++++++++++++++++
.../spatial-functions/st-distance.md | 112 ++++++++++++++++++
.../spatial-functions/st-geometrytype.md | 115 ++++++++++++++++++
.../spatial-functions/st-length.md | 131 +++++++++++++++++++++
sidebars.ts | 3 +
.../spatial-functions/st-distance.md | 112 ++++++++++++++++++
.../spatial-functions/st-geometrytype.md | 115 ++++++++++++++++++
.../spatial-functions/st-length.md | 131 +++++++++++++++++++++
versioned_sidebars/version-4.x-sidebars.json | 3 +
16 files changed, 1416 insertions(+), 2 deletions(-)
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-angle.md
b/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-angle.md
index 6cbd9c150cf..9e35fdac568 100644
---
a/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-angle.md
+++
b/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-angle.md
@@ -22,7 +22,7 @@ ST_ANGLE( <point1>, <point2>, <point3>)
|----------|--------------------------|
| `<point1>` | The first endpoint of the first line, of type `GeoPoint`
|
| `<point2>` | The second endpoint of the first line and the first endpoint of
the second line, of type `GeoPoint` |
-| `<point3>` | The second endpoint of the second line, of type `GeoPint` |
+| `<point3>` | The second endpoint of the second line, of type `GeoPoint` |
## Retuen Value
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
b/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
new file mode 100644
index 00000000000..96a58377c9b
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
@@ -0,0 +1,108 @@
+---
+{
+ "title": "ST_DISTANCE",
+ "language": "en",
+ "description": "Calculates the shortest distance on the sphere between two
geometry objects, in meters."
+}
+---
+
+## Description
+
+Calculates the shortest distance on the sphere between two geometry objects,
in meters. This function uses a spherical Earth model for calculation.
+
+Unlike `ST_DISTANCE_SPHERE`, which accepts longitude and latitude coordinates,
`ST_DISTANCE` accepts geometry objects (points, lines, polygons, circles, etc.)
as parameters and calculates the shortest distance between their boundaries. If
the two shapes intersect (including touching or containing each other), it
returns 0.
+
+## Syntax
+
+```sql
+ST_DISTANCE( <shape1>, <shape2> )
+```
+
+## Parameters
+
+| Parameter | Description |
+| :--- | :--- |
+| `<shape1>` | The first geometry, supporting Point, Line, Polygon, Circle,
MultiPolygon. |
+| `<shape2>` | The second geometry, supporting Point, Line, Polygon, Circle,
MultiPolygon. |
+
+## Return Value
+
+Returns the shortest spherical distance between the boundaries of the two
geometry objects, in meters (DOUBLE type).
+
+`ST_DISTANCE` has the following edge cases:
+- If any input parameter is `NULL`, returns `NULL`.
+- If any input parameter cannot be parsed into a valid geometry object,
returns `NULL`.
+- If the two geometry objects intersect (including one containing the other),
returns `0.0`.
+- Supported geometry types include: `POINT`, `LINESTRING`, `POLYGON`,
`CIRCLE`, `MULTIPOLYGON`.
+
+## Example
+
+**Distance Between Points**
+```sql
+-- Calculate the distance between two points with a 1-degree longitude
difference on the equator
+SELECT ST_DISTANCE(ST_GeometryFromText('POINT(0 0)'),
ST_GeometryFromText('POINT(1 0)'));
+```
+```text
++---------------------------------------------+
+| ST_Distance(ST_Point(0, 0), ST_Point(1, 0)) |
++---------------------------------------------+
+| 111195.1011774839 |
++---------------------------------------------+
+```
+
+**Distance Between a Point and a Line**
+```sql
+-- Calculate the shortest distance from a point to a line
+SELECT ST_DISTANCE(ST_GeometryFromText('POINT(2 2)'),
ST_GeometryFromText('LINESTRING(0 0, 10 0)'));
+```
+```text
++----------------------------------------------------------------------------------------------+
+| ST_DISTANCE(ST_GeometryFromText('POINT(2 2)'),
ST_GeometryFromText('LINESTRING(0 0, 10 0)')) |
++----------------------------------------------------------------------------------------------+
+|
222390.2023549678 |
++----------------------------------------------------------------------------------------------+
+```
+
+**Polygon and Circle Intersect (Distance 0)**
+```sql
+-- Circle intersects polygon; the center is outside but the circle covers part
of the polygon's boundary
+SELECT ST_DISTANCE(
+ ST_GeometryFromText('POLYGON ((-0.00045 -0.00045, 0.00045 -0.00045,
0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))'),
+ ST_Circle(0.0006, 0, 50)
+);
+```
+```text
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| ST_DISTANCE(
+ ST_GeometryFromText('POLYGON ((-0.00045 -0.00045, 0.00045 -0.00045,
0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))'),
+ ST_Circle(0.0006, 0, 50)
+) |
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+|
0 |
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+```
+
+**Invalid Parameter (Returns NULL)**
+```sql
+-- Invalid WKT string
+SELECT ST_DISTANCE(ST_GeometryFromText('NOT_A_GEOMETRY'),
ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++---------------------------------------------------------------------------------------+
+| ST_DISTANCE(ST_GeometryFromText('NOT_A_GEOMETRY'),
ST_GeometryFromText('POINT(1 1)')) |
++---------------------------------------------------------------------------------------+
+|
NULL |
++---------------------------------------------------------------------------------------+
+```
+
+**NULL Parameter**
+```sql
+SELECT ST_DISTANCE(NULL, ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++------------------------------------------------------+
+| ST_DISTANCE(NULL, ST_GeometryFromText('POINT(1 1)')) |
++------------------------------------------------------+
+| NULL |
++------------------------------------------------------+
+```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
b/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
new file mode 100644
index 00000000000..a50e1a4ad4e
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
@@ -0,0 +1,111 @@
+---
+{
+ "title": "ST_GEOMETRYTYPE",
+ "language": "en",
+ "description": "Returns the type name of a geometry object."
+}
+---
+
+## Description
+
+Returns the type name (in uppercase) of a given geometry object. Used to
identify the specific type of a geometric shape.
+
+## Syntax
+
+```sql
+ST_GEOMETRYTYPE( <shape> )
+```
+
+## Parameters
+
+| Parameter | Description |
+| :--- | :--- |
+| `<shape>` | The input geometry, of type GEOMETRY or VARCHAR (in WKT format)
that can be converted to GEOMETRY. |
+
+## Return Value
+
+Returns a VARCHAR type uppercase string representing the geometry object's
type.
+
+`ST_GEOMETRYTYPE` has the following edge cases:
+- If the input parameter is `NULL`, returns `NULL`.
+- If the input parameter cannot be parsed into a valid geometry object,
returns `NULL`.
+- Supported geometry types and their return value examples are as follows:
+ - `POINT`: `"ST_POINT"`
+ - `LINESTRING`: `"ST_LINESTRING"`
+ - `POLYGON`: `"ST_POLYGON"`
+ - `MULTIPOLYGON`: `"ST_MULTIPOLYGON"`
+ - `CIRCLE` : `"ST_CIRCLE"`
+
+## Example
+
+**Type of a Point**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++----------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_GeometryFromText('POINT(1 1)')) |
++----------------------------------------------------+
+| ST_POINT |
++----------------------------------------------------+
+```
+
+**Type of a Line**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_LineFromText("LINESTRING (1 1,2 2,3 3)"));
+```
+```text
++--------------------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_LineFromText("LINESTRING (1 1,2 2,3 3)")) |
++--------------------------------------------------------------+
+| ST_LINESTRING |
++--------------------------------------------------------------+
+```
+
+**Type of a Polygon**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_GeometryFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0
0))'));
+```
+```text
++--------------------------------------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_GeometryFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0
0))')) |
++--------------------------------------------------------------------------------+
+| ST_POLYGON
|
++--------------------------------------------------------------------------------+
+```
+
+**Type of a Circle (Doris Extension)**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_Circle(0, 0, 100));
+```
+```text
++---------------------------------------+
+| ST_GEOMETRYTYPE(ST_Circle(0, 0, 100)) |
++---------------------------------------+
+| ST_CIRCLE |
++---------------------------------------+
+```
+
+**Invalid Parameter (Returns NULL)**
+```sql
+SELECT ST_GEOMETRYTYPE('NOT_A_GEOMETRY');
+```
+```text
++-----------------------------------+
+| ST_GEOMETRYTYPE('NOT_A_GEOMETRY') |
++-----------------------------------+
+| NULL |
++-----------------------------------+
+```
+
+**NULL Parameter**
+```sql
+SELECT ST_GEOMETRYTYPE(NULL);
+```
+```text
++-----------------------+
+| ST_GEOMETRYTYPE(NULL) |
++-----------------------+
+| NULL |
++-----------------------+
+```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
b/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
new file mode 100644
index 00000000000..f100e1dc9d3
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
@@ -0,0 +1,127 @@
+---
+{
+ "title": "ST_LENGTH",
+ "language": "en",
+ "description": "Returns the length (or perimeter) of a line or surface
geometry object. The unit is meters."
+}
+---
+
+## Description
+
+Returns the spherical length of a line geometry object or the boundary
perimeter of a surface geometry object, in meters. This function uses a
spherical Earth model for calculation.
+- For `LINESTRING` or `MULTILINESTRING`, returns the sum of the great-circle
distances of all its segments on the sphere, i.e., the **length** of the line
object.
+- For `POLYGON` or `MULTIPOLYGON`, returns the sum of the great-circle
distances of its outer boundary and inner boundaries (holes) on the sphere,
i.e., the **perimeter** of the surface object.
+- For `CIRCLE`, returns its circumference, calculated by the formula `2 * π *
radius`.
+- For `POINT`, returns `0.0`.
+
+## Syntax
+
+```sql
+ST_LENGTH( <shape> )
+```
+
+## Parameters
+
+| Parameter | Description |
+| :--- | :--- |
+| `<shape>` | The input geometry, of type GEOMETRY or VARCHAR (in WKT format)
that can be converted to GEOMETRY. Supports types such as `LINESTRING`,
`POLYGON`, `CIRCLE`, `POINT`. |
+
+## Return Value
+
+Returns the length or perimeter of the geometry object, in meters (DOUBLE
type).
+
+`ST_LENGTH` has the following edge cases:
+- If the input parameter is `NULL`, returns `NULL`.
+- If the input parameter cannot be parsed into a valid geometry object,
returns `NULL`.
+- If the input geometry object is a `POINT` or a line of zero length, returns
`0.0`.
+- For the `CIRCLE` type, the radius parameter when created with `ST_CIRCLE`
must be in meters to ensure the correct circumference (in meters) is returned.
+
+## Example
+
+**Calculate the Length of a Line (LINESTRING)**
+```sql
+-- Calculate the length of a line segment with a 1-degree longitude difference
on the equator
+SELECT ST_LENGTH(ST_GeometryFromText('LINESTRING(0 0, 1 0)'));
+```
+```text
++--------------------------------------------------------+
+| ST_LENGTH(ST_GeometryFromText('LINESTRING(0 0, 1 0)')) |
++--------------------------------------------------------+
+| 111195.1011774839 |
++--------------------------------------------------------+
+```
+
+**Calculate the Perimeter of a Polygon (POLYGON)**
+```sql
+-- Calculate the perimeter of a small square with a side length of
approximately 0.0009 degrees (~100 meters)
+SELECT ST_LENGTH(ST_GeometryFromText('POLYGON((-0.00045 -0.00045, 0.00045
-0.00045, 0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))')) AS
perimeter;
+```
+```text
++-------------------+
+| perimeter |
++-------------------+
+| 400.3023642327689 |
++-------------------+
+```
+
+**Calculate the Circumference of a Circle (CIRCLE)**
+```sql
+-- Calculate the circumference of a circle with a radius of 100 meters
+SELECT ST_LENGTH(ST_Circle(0, 0, 100));
+```
+```text
++---------------------------------+
+| ST_LENGTH(ST_Circle(0, 0, 100)) |
++---------------------------------+
+| 628.3185307179587 |
++---------------------------------+
+```
+
+**Length of a Point**
+```sql
+SELECT ST_LENGTH(ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++----------------------------------------------+
+| ST_LENGTH(ST_GeometryFromText('POINT(1 1)')) |
++----------------------------------------------+
+| 0 |
++----------------------------------------------+
+```
+
+**Invalid Parameter (Returns NULL)**
+```sql
+SELECT ST_LENGTH('NOT_A_GEOMETRY');
+```
+```text
++-----------------------------+
+| ST_LENGTH('NOT_A_GEOMETRY') |
++-----------------------------+
+| NULL |
++-----------------------------+
+```
+
+**NULL Parameter**
+```sql
+SELECT ST_LENGTH(NULL);
+```
+```text
++-----------------+
+| ST_LENGTH(NULL) |
++-----------------+
+| NULL |
++-----------------+
+```
+
+**Length of a Complex Line Object**
+```sql
+-- Calculate the total length of a polyline
+SELECT ST_LENGTH(ST_LineFromText("LINESTRING (0 0,1 0,1 1)"));
+```
+```text
++--------------------------------------------------------+
+| ST_LENGTH(ST_LineFromText("LINESTRING (0 0,1 0,1 1)")) |
++--------------------------------------------------------+
+| 222390.2023549679 |
++--------------------------------------------------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-angle.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-angle.md
index bc43e43bb55..e8869bb58fe 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-angle.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-angle.md
@@ -22,7 +22,7 @@ ST_ANGLE( <point1>, <point2>, <point3>)
|----------|--------------------------|
| `<point1>` | 第一条直线的第一个端点 ,类型为 `GeoPoint` |
| `<point2>` | 第一条直线的第二个端点且是第二条直线的第一个端点, 类型为 `GeoPoint` |
-| `<point3>` | 第二条直线的第二个端点, 类型为 `GeoPint` |
+| `<point3>` | 第二条直线的第二个端点, 类型为 `GeoPoint` |
## 返回值
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
new file mode 100644
index 00000000000..701d737ab7b
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
@@ -0,0 +1,108 @@
+---
+{
+ "title": "ST_DISTANCE",
+ "language": "zh-CN",
+ "description": "计算两个几何图形(Geometry)在球面上的最短距离,单位为米。"
+}
+---
+
+## 描述
+
+计算两个几何图形在球面上的最短距离,单位为米。此函数使用球面地球模型进行计算。
+
+与 `ST_DISTANCE_SPHERE` 接受经纬度坐标不同,`ST_DISTANCE`
接受几何对象(点、线、多边形、圆等)作为参数,并计算它们边界之间的最短距离。若两个图形相交(包括接触或包含),则返回 0。
+
+## 语法
+
+```sql
+ST_DISTANCE( <shape1>, <shape2> )
+```
+
+## 参数
+
+| 参数 | 说明 |
+| :--- | :--- |
+| `<shape1>` | 第一个几何图形,支持 Point,Line,Polygon,Circle,MultiPolygon。 |
+| `<shape2>` | 第二个几何图形,支持 Point,Line,Polygon,Circle,MultiPolygon。 |
+
+## 返回值
+
+返回两个几何图形边界之间的最短球面距离,单位为米(DOUBLE 类型)。
+
+`ST_DISTANCE` 存在以下边缘情况:
+- 若任一输入参数为 `NULL`,返回 `NULL`。
+- 若任一输入参数无法解析为有效的几何对象,返回 `NULL`。
+- 若两个几何图形相交(包括一个图形包含另一个图形),返回 `0.0`。
+- 支持的几何类型包括:`POINT`, `LINESTRING`, `POLYGON`, `CIRCLE`, `MULTIPOLYGON`。
+
+## 举例
+
+**点与点之间的距离**
+```sql
+-- 计算赤道上经度相差 1 度的两个点之间的距离
+SELECT ST_DISTANCE(ST_GeometryFromText('POINT(0 0)'),
ST_GeometryFromText('POINT(1 0)'));
+```
+```text
++---------------------------------------------+
+| ST_Distance(ST_Point(0, 0), ST_Point(1, 0)) |
++---------------------------------------------+
+| 111195.1011774839 |
++---------------------------------------------+
+```
+
+**点与线之间的距离**
+```sql
+-- 计算点到线的最短距离
+SELECT ST_DISTANCE(ST_GeometryFromText('POINT(2 2)'),
ST_GeometryFromText('LINESTRING(0 0, 10 0)'));
+```
+```text
++----------------------------------------------------------------------------------------------+
+| ST_DISTANCE(ST_GeometryFromText('POINT(2 2)'),
ST_GeometryFromText('LINESTRING(0 0, 10 0)')) |
++----------------------------------------------------------------------------------------------+
+|
222390.2023549678 |
++----------------------------------------------------------------------------------------------+
+```
+
+**多边形与圆相交(距离为 0)**
+```sql
+-- 圆与多边形相交,圆心在外但圆包含了多边形的一部分边界
+SELECT ST_DISTANCE(
+ ST_GeometryFromText('POLYGON ((-0.00045 -0.00045, 0.00045 -0.00045,
0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))'),
+ ST_Circle(0.0006, 0, 50)
+);
+```
+```text
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| ST_DISTANCE(
+ ST_GeometryFromText('POLYGON ((-0.00045 -0.00045, 0.00045 -0.00045,
0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))'),
+ ST_Circle(0.0006, 0, 50)
+) |
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+|
0 |
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+```
+
+**无效参数(返回 NULL)**
+```sql
+-- 无效的 WKT 字符串
+SELECT ST_DISTANCE(ST_GeometryFromText('NOT_A_GEOMETRY'),
ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++---------------------------------------------------------------------------------------+
+| ST_DISTANCE(ST_GeometryFromText('NOT_A_GEOMETRY'),
ST_GeometryFromText('POINT(1 1)')) |
++---------------------------------------------------------------------------------------+
+|
NULL |
++---------------------------------------------------------------------------------------+
+```
+
+**NULL 参数**
+```sql
+SELECT ST_DISTANCE(NULL, ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++------------------------------------------------------+
+| ST_DISTANCE(NULL, ST_GeometryFromText('POINT(1 1)')) |
++------------------------------------------------------+
+| NULL |
++------------------------------------------------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
new file mode 100644
index 00000000000..0145ee4bb96
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
@@ -0,0 +1,111 @@
+---
+{
+ "title": "ST_GEOMETRYTYPE",
+ "language": "zh-CN",
+ "description": "返回几何对象的类型名称。"
+}
+---
+
+## 描述
+
+返回给定几何对象的类型名称(大写字符串)。用于识别几何图形的具体类型。
+
+## 语法
+
+```sql
+ST_GEOMETRYTYPE( <shape> )
+```
+
+## 参数
+
+| 参数 | 说明 |
+| :--- | :--- |
+| `<shape>` | 输入的几何图形,类型为 GEOMETRY 或可以转换为 GEOMETRY 的 VARCHAR(WKT 格式)。 |
+
+## 返回值
+
+返回一个 VARCHAR 类型的大写字符串,表示几何对象的类型。
+
+`ST_GEOMETRYTYPE` 存在以下边缘情况:
+- 若输入参数为 `NULL`,返回 `NULL`。
+- 若输入参数无法解析为有效的几何对象,返回 `NULL`。
+- 支持的几何类型及返回值示例如下:
+ - `POINT`: `"ST_POINT"`
+ - `LINESTRING`: `"ST_LINESTRING"`
+ - `POLYGON`: `"ST_POLYGON"`
+ - `MULTIPOLYGON`: `"ST_MULTIPOLYGON"`
+ - `CIRCLE` : `"ST_CIRCLE"`
+
+## 举例
+
+**点的类型**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++----------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_GeometryFromText('POINT(1 1)')) |
++----------------------------------------------------+
+| ST_POINT |
++----------------------------------------------------+
+```
+
+**线的类型**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_LineFromText("LINESTRING (1 1,2 2,3 3)"));
+```
+```text
++--------------------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_LineFromText("LINESTRING (1 1,2 2,3 3)")) |
++--------------------------------------------------------------+
+| ST_LINESTRING |
++--------------------------------------------------------------+
+```
+
+**多边形的类型**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_GeometryFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0
0))'));
+```
+```text
++--------------------------------------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_GeometryFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0
0))')) |
++--------------------------------------------------------------------------------+
+| ST_POLYGON
|
++--------------------------------------------------------------------------------+
+```
+
+**圆的类型 (Doris 扩展)**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_Circle(0, 0, 100));
+```
+```text
++---------------------------------------+
+| ST_GEOMETRYTYPE(ST_Circle(0, 0, 100)) |
++---------------------------------------+
+| ST_CIRCLE |
++---------------------------------------+
+```
+
+**无效参数(返回 NULL)**
+```sql
+SELECT ST_GEOMETRYTYPE('NOT_A_GEOMETRY');
+```
+```text
++-----------------------------------+
+| ST_GEOMETRYTYPE('NOT_A_GEOMETRY') |
++-----------------------------------+
+| NULL |
++-----------------------------------+
+```
+
+**NULL 参数**
+```sql
+SELECT ST_GEOMETRYTYPE(NULL);
+```
+```text
++-----------------------+
+| ST_GEOMETRYTYPE(NULL) |
++-----------------------+
+| NULL |
++-----------------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
new file mode 100644
index 00000000000..1d9fa25cf71
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
@@ -0,0 +1,127 @@
+---
+{
+ "title": "ST_LENGTH",
+ "language": "zh-CN",
+ "description": "返回线或面几何对象的长度(周长)。单位为米。"
+}
+---
+
+## 描述
+
+返回线几何对象的球面长度,或面几何对象的边界周长,单位为米。此函数使用球面地球模型进行计算。
+- 对于 `LINESTRING`(线)或 `MULTILINESTRING`(多线),返回其所有线段在球面上的大圆距离之和,即线对象的**长度**。
+- 对于 `POLYGON`(多边形)或
`MULTIPOLYGON`(多多边形),返回其外边界和内边界(孔洞)在球面上的大圆距离之和,即面对象的**周长**。
+- 对于 `CIRCLE`(圆),返回其圆周长,计算公式为 `2 * π * 半径`。
+- 对于 `POINT`(点),返回 `0.0`。
+
+## 语法
+
+```sql
+ST_LENGTH( <shape> )
+```
+
+## 参数
+
+| 参数 | 说明 |
+| :--- | :--- |
+| `<shape>` | 输入的几何图形,类型为 GEOMETRY 或可以转换为 GEOMETRY 的 VARCHAR(WKT 格式)。支持
`LINESTRING`, `POLYGON`, `CIRCLE`, `POINT` 等类型。 |
+
+## 返回值
+
+返回几何对象的长度或周长,单位为米(DOUBLE 类型)。
+
+`ST_LENGTH` 存在以下边缘情况:
+- 若输入参数为 `NULL`,返回 `NULL`。
+- 若输入参数无法解析为有效的几何对象,返回 `NULL`。
+- 若输入几何对象为 `POINT`或长度为零的线,返回 `0.0`。
+- 对于 `CIRCLE` 类型,使用ST_CIRCLE创建时半径参数的单位必须为米,以确保返回正确的圆周长(米)。
+
+## 举例
+
+**计算线的长度 (LINESTRING)**
+```sql
+-- 计算赤道上一段经度相差 1 度的线段的长度
+SELECT ST_LENGTH(ST_GeometryFromText('LINESTRING(0 0, 1 0)'));
+```
+```text
++--------------------------------------------------------+
+| ST_LENGTH(ST_GeometryFromText('LINESTRING(0 0, 1 0)')) |
++--------------------------------------------------------+
+| 111195.1011774839 |
++--------------------------------------------------------+
+```
+
+**计算多边形的周长 (POLYGON)**
+```sql
+-- 计算一个边长约0.0009度(约100米)的小正方形的周长
+SELECT ST_LENGTH(ST_GeometryFromText('POLYGON((-0.00045 -0.00045, 0.00045
-0.00045, 0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))')) AS
perimeter;
+```
+```text
++-------------------+
+| perimeter |
++-------------------+
+| 400.3023642327689 |
++-------------------+
+```
+
+**计算圆的周长 (CIRCLE)**
+```sql
+-- 计算半径为 100 米的圆的周长
+SELECT ST_LENGTH(ST_Circle(0, 0, 100));
+```
+```text
++---------------------------------+
+| ST_LENGTH(ST_Circle(0, 0, 100)) |
++---------------------------------+
+| 628.3185307179587 |
++---------------------------------+
+```
+
+**点的长度**
+```sql
+SELECT ST_LENGTH(ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++----------------------------------------------+
+| ST_LENGTH(ST_GeometryFromText('POINT(1 1)')) |
++----------------------------------------------+
+| 0 |
++----------------------------------------------+
+```
+
+**无效参数(返回 NULL)**
+```sql
+SELECT ST_LENGTH('NOT_A_GEOMETRY');
+```
+```text
++-----------------------------+
+| ST_LENGTH('NOT_A_GEOMETRY') |
++-----------------------------+
+| NULL |
++-----------------------------+
+```
+
+**NULL 参数**
+```sql
+SELECT ST_LENGTH(NULL);
+```
+```text
++-----------------+
+| ST_LENGTH(NULL) |
++-----------------+
+| NULL |
++-----------------+
+```
+
+**复杂线对象的长度**
+```sql
+-- 计算一条折线的总长度
+SELECT ST_LENGTH(ST_LineFromText("LINESTRING (0 0,1 0,1 1)"));
+```
+```text
++--------------------------------------------------------+
+| ST_LENGTH(ST_LineFromText("LINESTRING (0 0,1 0,1 1)")) |
++--------------------------------------------------------+
+| 222390.2023549679 |
++--------------------------------------------------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
new file mode 100644
index 00000000000..169b0f071c0
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
@@ -0,0 +1,112 @@
+---
+{
+ "title": "ST_DISTANCE",
+ "language": "zh-CN",
+ "description": "计算两个几何图形(Geometry)在球面上的最短距离,单位为米。"
+}
+---
+
+## 描述
+
+计算两个几何图形在球面上的最短距离,单位为米。此函数使用球面地球模型进行计算。
+
+与 `ST_DISTANCE_SPHERE` 接受经纬度坐标不同,`ST_DISTANCE`
接受几何对象(点、线、多边形、圆等)作为参数,并计算它们边界之间的最短距离。若两个图形相交(包括接触或包含),则返回 0。
+
+:::info 备注
+从 Apache Doris 4.0.4 开始支持该函数
+:::
+
+## 语法
+
+```sql
+ST_DISTANCE( <shape1>, <shape2> )
+```
+
+## 参数
+
+| 参数 | 说明 |
+| :--- | :--- |
+| `<shape1>` | 第一个几何图形,支持 Point,Line,Polygon,Circle,MultiPolygon。 |
+| `<shape2>` | 第二个几何图形,支持 Point,Line,Polygon,Circle,MultiPolygon。 |
+
+## 返回值
+
+返回两个几何图形边界之间的最短球面距离,单位为米(DOUBLE 类型)。
+
+`ST_DISTANCE` 存在以下边缘情况:
+- 若任一输入参数为 `NULL`,返回 `NULL`。
+- 若任一输入参数无法解析为有效的几何对象,返回 `NULL`。
+- 若两个几何图形相交(包括一个图形包含另一个图形),返回 `0.0`。
+- 支持的几何类型包括:`POINT`, `LINESTRING`, `POLYGON`, `CIRCLE`, `MULTIPOLYGON`。
+
+## 举例
+
+**点与点之间的距离**
+```sql
+-- 计算赤道上经度相差 1 度的两个点之间的距离
+SELECT ST_DISTANCE(ST_GeometryFromText('POINT(0 0)'),
ST_GeometryFromText('POINT(1 0)'));
+```
+```text
++---------------------------------------------+
+| ST_Distance(ST_Point(0, 0), ST_Point(1, 0)) |
++---------------------------------------------+
+| 111195.1011774839 |
++---------------------------------------------+
+```
+
+**点与线之间的距离**
+```sql
+-- 计算点到线的最短距离
+SELECT ST_DISTANCE(ST_GeometryFromText('POINT(2 2)'),
ST_GeometryFromText('LINESTRING(0 0, 10 0)'));
+```
+```text
++----------------------------------------------------------------------------------------------+
+| ST_DISTANCE(ST_GeometryFromText('POINT(2 2)'),
ST_GeometryFromText('LINESTRING(0 0, 10 0)')) |
++----------------------------------------------------------------------------------------------+
+|
222390.2023549678 |
++----------------------------------------------------------------------------------------------+
+```
+
+**多边形与圆相交(距离为 0)**
+```sql
+-- 圆与多边形相交,圆心在外但圆包含了多边形的一部分边界
+SELECT ST_DISTANCE(
+ ST_GeometryFromText('POLYGON ((-0.00045 -0.00045, 0.00045 -0.00045,
0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))'),
+ ST_Circle(0.0006, 0, 50)
+);
+```
+```text
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| ST_DISTANCE(
+ ST_GeometryFromText('POLYGON ((-0.00045 -0.00045, 0.00045 -0.00045,
0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))'),
+ ST_Circle(0.0006, 0, 50)
+) |
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+|
0 |
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+```
+
+**无效参数(返回 NULL)**
+```sql
+-- 无效的 WKT 字符串
+SELECT ST_DISTANCE(ST_GeometryFromText('NOT_A_GEOMETRY'),
ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++---------------------------------------------------------------------------------------+
+| ST_DISTANCE(ST_GeometryFromText('NOT_A_GEOMETRY'),
ST_GeometryFromText('POINT(1 1)')) |
++---------------------------------------------------------------------------------------+
+|
NULL |
++---------------------------------------------------------------------------------------+
+```
+
+**NULL 参数**
+```sql
+SELECT ST_DISTANCE(NULL, ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++------------------------------------------------------+
+| ST_DISTANCE(NULL, ST_GeometryFromText('POINT(1 1)')) |
++------------------------------------------------------+
+| NULL |
++------------------------------------------------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
new file mode 100644
index 00000000000..27321e12b2f
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
@@ -0,0 +1,115 @@
+---
+{
+ "title": "ST_GEOMETRYTYPE",
+ "language": "zh-CN",
+ "description": "返回几何对象的类型名称。"
+}
+---
+
+## 描述
+
+返回给定几何对象的类型名称(大写字符串)。用于识别几何图形的具体类型。
+
+:::info 备注
+从 Apache Doris 4.0.4 开始支持该函数
+:::
+
+## 语法
+
+```sql
+ST_GEOMETRYTYPE( <shape> )
+```
+
+## 参数
+
+| 参数 | 说明 |
+| :--- | :--- |
+| `<shape>` | 输入的几何图形,类型为 GEOMETRY 或可以转换为 GEOMETRY 的 VARCHAR(WKT 格式)。 |
+
+## 返回值
+
+返回一个 VARCHAR 类型的大写字符串,表示几何对象的类型。
+
+`ST_GEOMETRYTYPE` 存在以下边缘情况:
+- 若输入参数为 `NULL`,返回 `NULL`。
+- 若输入参数无法解析为有效的几何对象,返回 `NULL`。
+- 支持的几何类型及返回值示例如下:
+ - `POINT`: `"ST_POINT"`
+ - `LINESTRING`: `"ST_LINESTRING"`
+ - `POLYGON`: `"ST_POLYGON"`
+ - `MULTIPOLYGON`: `"ST_MULTIPOLYGON"`
+ - `CIRCLE` : `"ST_CIRCLE"`
+
+## 举例
+
+**点的类型**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++----------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_GeometryFromText('POINT(1 1)')) |
++----------------------------------------------------+
+| ST_POINT |
++----------------------------------------------------+
+```
+
+**线的类型**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_LineFromText("LINESTRING (1 1,2 2,3 3)"));
+```
+```text
++--------------------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_LineFromText("LINESTRING (1 1,2 2,3 3)")) |
++--------------------------------------------------------------+
+| ST_LINESTRING |
++--------------------------------------------------------------+
+```
+
+**多边形的类型**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_GeometryFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0
0))'));
+```
+```text
++--------------------------------------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_GeometryFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0
0))')) |
++--------------------------------------------------------------------------------+
+| ST_POLYGON
|
++--------------------------------------------------------------------------------+
+```
+
+**圆的类型 (Doris 扩展)**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_Circle(0, 0, 100));
+```
+```text
++---------------------------------------+
+| ST_GEOMETRYTYPE(ST_Circle(0, 0, 100)) |
++---------------------------------------+
+| ST_CIRCLE |
++---------------------------------------+
+```
+
+**无效参数(返回 NULL)**
+```sql
+SELECT ST_GEOMETRYTYPE('NOT_A_GEOMETRY');
+```
+```text
++-----------------------------------+
+| ST_GEOMETRYTYPE('NOT_A_GEOMETRY') |
++-----------------------------------+
+| NULL |
++-----------------------------------+
+```
+
+**NULL 参数**
+```sql
+SELECT ST_GEOMETRYTYPE(NULL);
+```
+```text
++-----------------------+
+| ST_GEOMETRYTYPE(NULL) |
++-----------------------+
+| NULL |
++-----------------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
new file mode 100644
index 00000000000..31f6fb0bc56
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
@@ -0,0 +1,131 @@
+---
+{
+ "title": "ST_LENGTH",
+ "language": "zh-CN",
+ "description": "返回线或面几何对象的长度(周长)。单位为米。"
+}
+---
+
+## 描述
+
+返回线几何对象的球面长度,或面几何对象的边界周长,单位为米。此函数使用球面地球模型进行计算。
+- 对于 `LINESTRING`(线)或 `MULTILINESTRING`(多线),返回其所有线段在球面上的大圆距离之和,即线对象的**长度**。
+- 对于 `POLYGON`(多边形)或
`MULTIPOLYGON`(多多边形),返回其外边界和内边界(孔洞)在球面上的大圆距离之和,即面对象的**周长**。
+- 对于 `CIRCLE`(圆),返回其圆周长,计算公式为 `2 * π * 半径`。
+- 对于 `POINT`(点),返回 `0.0`。
+
+:::info 备注
+从 Apache Doris 4.0.4 开始支持该函数
+:::
+
+## 语法
+
+```sql
+ST_LENGTH( <shape> )
+```
+
+## 参数
+
+| 参数 | 说明 |
+| :--- | :--- |
+| `<shape>` | 输入的几何图形,类型为 GEOMETRY 或可以转换为 GEOMETRY 的 VARCHAR(WKT 格式)。支持
`LINESTRING`, `POLYGON`, `CIRCLE`, `POINT` 等类型。 |
+
+## 返回值
+
+返回几何对象的长度或周长,单位为米(DOUBLE 类型)。
+
+`ST_LENGTH` 存在以下边缘情况:
+- 若输入参数为 `NULL`,返回 `NULL`。
+- 若输入参数无法解析为有效的几何对象,返回 `NULL`。
+- 若输入几何对象为 `POINT`或长度为零的线,返回 `0.0`。
+- 对于 `CIRCLE` 类型,使用ST_CIRCLE创建时半径参数的单位必须为米,以确保返回正确的圆周长(米)。
+
+## 举例
+
+**计算线的长度 (LINESTRING)**
+```sql
+-- 计算赤道上一段经度相差 1 度的线段的长度
+SELECT ST_LENGTH(ST_GeometryFromText('LINESTRING(0 0, 1 0)'));
+```
+```text
++--------------------------------------------------------+
+| ST_LENGTH(ST_GeometryFromText('LINESTRING(0 0, 1 0)')) |
++--------------------------------------------------------+
+| 111195.1011774839 |
++--------------------------------------------------------+
+```
+
+**计算多边形的周长 (POLYGON)**
+```sql
+-- 计算一个边长约0.0009度(约100米)的小正方形的周长
+SELECT ST_LENGTH(ST_GeometryFromText('POLYGON((-0.00045 -0.00045, 0.00045
-0.00045, 0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))')) AS
perimeter;
+```
+```text
++-------------------+
+| perimeter |
++-------------------+
+| 400.3023642327689 |
++-------------------+
+```
+
+**计算圆的周长 (CIRCLE)**
+```sql
+-- 计算半径为 100 米的圆的周长
+SELECT ST_LENGTH(ST_Circle(0, 0, 100));
+```
+```text
++---------------------------------+
+| ST_LENGTH(ST_Circle(0, 0, 100)) |
++---------------------------------+
+| 628.3185307179587 |
++---------------------------------+
+```
+
+**点的长度**
+```sql
+SELECT ST_LENGTH(ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++----------------------------------------------+
+| ST_LENGTH(ST_GeometryFromText('POINT(1 1)')) |
++----------------------------------------------+
+| 0 |
++----------------------------------------------+
+```
+
+**无效参数(返回 NULL)**
+```sql
+SELECT ST_LENGTH('NOT_A_GEOMETRY');
+```
+```text
++-----------------------------+
+| ST_LENGTH('NOT_A_GEOMETRY') |
++-----------------------------+
+| NULL |
++-----------------------------+
+```
+
+**NULL 参数**
+```sql
+SELECT ST_LENGTH(NULL);
+```
+```text
++-----------------+
+| ST_LENGTH(NULL) |
++-----------------+
+| NULL |
++-----------------+
+```
+
+**复杂线对象的长度**
+```sql
+-- 计算一条折线的总长度
+SELECT ST_LENGTH(ST_LineFromText("LINESTRING (0 0,1 0,1 1)"));
+```
+```text
++--------------------------------------------------------+
+| ST_LENGTH(ST_LineFromText("LINESTRING (0 0,1 0,1 1)")) |
++--------------------------------------------------------+
+| 222390.2023549679 |
++--------------------------------------------------------+
+```
\ No newline at end of file
diff --git a/sidebars.ts b/sidebars.ts
index ee8854b2c2c..99348556d77 100644
--- a/sidebars.ts
+++ b/sidebars.ts
@@ -1546,10 +1546,13 @@ const sidebars: SidebarsConfig = {
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-circle',
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-contains',
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-disjoint',
+
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance',
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance-sphere',
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometryfromtext',
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometryfromwkb',
+
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype',
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-intersects',
+
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-length',
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-linefromtext',
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-point',
'sql-manual/sql-functions/scalar-functions/spatial-functions/st-polygon',
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
new file mode 100644
index 00000000000..f55f54434aa
--- /dev/null
+++
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance.md
@@ -0,0 +1,112 @@
+---
+{
+ "title": "ST_DISTANCE",
+ "language": "en",
+ "description": "Calculates the shortest distance on the sphere between two
geometry objects, in meters."
+}
+---
+
+## Description
+
+Calculates the shortest distance on the sphere between two geometry objects,
in meters. This function uses a spherical Earth model for calculation.
+
+Unlike `ST_DISTANCE_SPHERE`, which accepts longitude and latitude coordinates,
`ST_DISTANCE` accepts geometry objects (points, lines, polygons, circles, etc.)
as parameters and calculates the shortest distance between their boundaries. If
the two shapes intersect (including touching or containing each other), it
returns 0.
+
+:::info Note
+Supported since Apache Doris 4.0.4
+:::
+
+## Syntax
+
+```sql
+ST_DISTANCE( <shape1>, <shape2> )
+```
+
+## Parameters
+
+| Parameter | Description |
+| :--- | :--- |
+| `<shape1>` | The first geometry, supporting Point, Line, Polygon, Circle,
MultiPolygon. |
+| `<shape2>` | The second geometry, supporting Point, Line, Polygon, Circle,
MultiPolygon. |
+
+## Return Value
+
+Returns the shortest spherical distance between the boundaries of the two
geometry objects, in meters (DOUBLE type).
+
+`ST_DISTANCE` has the following edge cases:
+- If any input parameter is `NULL`, returns `NULL`.
+- If any input parameter cannot be parsed into a valid geometry object,
returns `NULL`.
+- If the two geometry objects intersect (including one containing the other),
returns `0.0`.
+- Supported geometry types include: `POINT`, `LINESTRING`, `POLYGON`,
`CIRCLE`, `MULTIPOLYGON`.
+
+## Example
+
+**Distance Between Points**
+```sql
+-- Calculate the distance between two points with a 1-degree longitude
difference on the equator
+SELECT ST_DISTANCE(ST_GeometryFromText('POINT(0 0)'),
ST_GeometryFromText('POINT(1 0)'));
+```
+```text
++---------------------------------------------+
+| ST_Distance(ST_Point(0, 0), ST_Point(1, 0)) |
++---------------------------------------------+
+| 111195.1011774839 |
++---------------------------------------------+
+```
+
+**Distance Between a Point and a Line**
+```sql
+-- Calculate the shortest distance from a point to a line
+SELECT ST_DISTANCE(ST_GeometryFromText('POINT(2 2)'),
ST_GeometryFromText('LINESTRING(0 0, 10 0)'));
+```
+```text
++----------------------------------------------------------------------------------------------+
+| ST_DISTANCE(ST_GeometryFromText('POINT(2 2)'),
ST_GeometryFromText('LINESTRING(0 0, 10 0)')) |
++----------------------------------------------------------------------------------------------+
+|
222390.2023549678 |
++----------------------------------------------------------------------------------------------+
+```
+
+**Polygon and Circle Intersect (Distance 0)**
+```sql
+-- Circle intersects polygon; the center is outside but the circle covers part
of the polygon's boundary
+SELECT ST_DISTANCE(
+ ST_GeometryFromText('POLYGON ((-0.00045 -0.00045, 0.00045 -0.00045,
0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))'),
+ ST_Circle(0.0006, 0, 50)
+);
+```
+```text
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| ST_DISTANCE(
+ ST_GeometryFromText('POLYGON ((-0.00045 -0.00045, 0.00045 -0.00045,
0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))'),
+ ST_Circle(0.0006, 0, 50)
+) |
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+|
0 |
++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+```
+
+**Invalid Parameter (Returns NULL)**
+```sql
+-- Invalid WKT string
+SELECT ST_DISTANCE(ST_GeometryFromText('NOT_A_GEOMETRY'),
ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++---------------------------------------------------------------------------------------+
+| ST_DISTANCE(ST_GeometryFromText('NOT_A_GEOMETRY'),
ST_GeometryFromText('POINT(1 1)')) |
++---------------------------------------------------------------------------------------+
+|
NULL |
++---------------------------------------------------------------------------------------+
+```
+
+**NULL Parameter**
+```sql
+SELECT ST_DISTANCE(NULL, ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++------------------------------------------------------+
+| ST_DISTANCE(NULL, ST_GeometryFromText('POINT(1 1)')) |
++------------------------------------------------------+
+| NULL |
++------------------------------------------------------+
+```
\ No newline at end of file
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
new file mode 100644
index 00000000000..a91254dea73
--- /dev/null
+++
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype.md
@@ -0,0 +1,115 @@
+---
+{
+ "title": "ST_GEOMETRYTYPE",
+ "language": "en",
+ "description": "Returns the type name of a geometry object."
+}
+---
+
+## Description
+
+Returns the type name (in uppercase) of a given geometry object. Used to
identify the specific type of a geometric shape.
+
+:::info Note
+Supported since Apache Doris 4.0.4
+:::
+
+## Syntax
+
+```sql
+ST_GEOMETRYTYPE( <shape> )
+```
+
+## Parameters
+
+| Parameter | Description |
+| :--- | :--- |
+| `<shape>` | The input geometry, of type GEOMETRY or VARCHAR (in WKT format)
that can be converted to GEOMETRY. |
+
+## Return Value
+
+Returns a VARCHAR type uppercase string representing the geometry object's
type.
+
+`ST_GEOMETRYTYPE` has the following edge cases:
+- If the input parameter is `NULL`, returns `NULL`.
+- If the input parameter cannot be parsed into a valid geometry object,
returns `NULL`.
+- Supported geometry types and their return value examples are as follows:
+ - `POINT`: `"ST_POINT"`
+ - `LINESTRING`: `"ST_LINESTRING"`
+ - `POLYGON`: `"ST_POLYGON"`
+ - `MULTIPOLYGON`: `"ST_MULTIPOLYGON"`
+ - `CIRCLE` : `"ST_CIRCLE"`
+
+## Example
+
+**Type of a Point**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++----------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_GeometryFromText('POINT(1 1)')) |
++----------------------------------------------------+
+| ST_POINT |
++----------------------------------------------------+
+```
+
+**Type of a Line**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_LineFromText("LINESTRING (1 1,2 2,3 3)"));
+```
+```text
++--------------------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_LineFromText("LINESTRING (1 1,2 2,3 3)")) |
++--------------------------------------------------------------+
+| ST_LINESTRING |
++--------------------------------------------------------------+
+```
+
+**Type of a Polygon**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_GeometryFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0
0))'));
+```
+```text
++--------------------------------------------------------------------------------+
+| ST_GEOMETRYTYPE(ST_GeometryFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0
0))')) |
++--------------------------------------------------------------------------------+
+| ST_POLYGON
|
++--------------------------------------------------------------------------------+
+```
+
+**Type of a Circle (Doris Extension)**
+```sql
+SELECT ST_GEOMETRYTYPE(ST_Circle(0, 0, 100));
+```
+```text
++---------------------------------------+
+| ST_GEOMETRYTYPE(ST_Circle(0, 0, 100)) |
++---------------------------------------+
+| ST_CIRCLE |
++---------------------------------------+
+```
+
+**Invalid Parameter (Returns NULL)**
+```sql
+SELECT ST_GEOMETRYTYPE('NOT_A_GEOMETRY');
+```
+```text
++-----------------------------------+
+| ST_GEOMETRYTYPE('NOT_A_GEOMETRY') |
++-----------------------------------+
+| NULL |
++-----------------------------------+
+```
+
+**NULL Parameter**
+```sql
+SELECT ST_GEOMETRYTYPE(NULL);
+```
+```text
++-----------------------+
+| ST_GEOMETRYTYPE(NULL) |
++-----------------------+
+| NULL |
++-----------------------+
+```
\ No newline at end of file
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
new file mode 100644
index 00000000000..10af205316e
--- /dev/null
+++
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/spatial-functions/st-length.md
@@ -0,0 +1,131 @@
+---
+{
+ "title": "ST_LENGTH",
+ "language": "en",
+ "description": "Returns the length (or perimeter) of a line or surface
geometry object. The unit is meters."
+}
+---
+
+## Description
+
+Returns the spherical length of a line geometry object or the boundary
perimeter of a surface geometry object, in meters. This function uses a
spherical Earth model for calculation.
+- For `LINESTRING` or `MULTILINESTRING`, returns the sum of the great-circle
distances of all its segments on the sphere, i.e., the **length** of the line
object.
+- For `POLYGON` or `MULTIPOLYGON`, returns the sum of the great-circle
distances of its outer boundary and inner boundaries (holes) on the sphere,
i.e., the **perimeter** of the surface object.
+- For `CIRCLE`, returns its circumference, calculated by the formula `2 * π *
radius`.
+- For `POINT`, returns `0.0`.
+
+:::info Note
+Supported since Apache Doris 4.0.4
+:::
+
+## Syntax
+
+```sql
+ST_LENGTH( <shape> )
+```
+
+## Parameters
+
+| Parameter | Description |
+| :--- | :--- |
+| `<shape>` | The input geometry, of type GEOMETRY or VARCHAR (in WKT format)
that can be converted to GEOMETRY. Supports types such as `LINESTRING`,
`POLYGON`, `CIRCLE`, `POINT`. |
+
+## Return Value
+
+Returns the length or perimeter of the geometry object, in meters (DOUBLE
type).
+
+`ST_LENGTH` has the following edge cases:
+- If the input parameter is `NULL`, returns `NULL`.
+- If the input parameter cannot be parsed into a valid geometry object,
returns `NULL`.
+- If the input geometry object is a `POINT` or a line of zero length, returns
`0.0`.
+- For the `CIRCLE` type, the radius parameter when created with `ST_CIRCLE`
must be in meters to ensure the correct circumference (in meters) is returned.
+
+## Example
+
+**Calculate the Length of a Line (LINESTRING)**
+```sql
+-- Calculate the length of a line segment with a 1-degree longitude difference
on the equator
+SELECT ST_LENGTH(ST_GeometryFromText('LINESTRING(0 0, 1 0)'));
+```
+```text
++--------------------------------------------------------+
+| ST_LENGTH(ST_GeometryFromText('LINESTRING(0 0, 1 0)')) |
++--------------------------------------------------------+
+| 111195.1011774839 |
++--------------------------------------------------------+
+```
+
+**Calculate the Perimeter of a Polygon (POLYGON)**
+```sql
+-- Calculate the perimeter of a small square with a side length of
approximately 0.0009 degrees (~100 meters)
+SELECT ST_LENGTH(ST_GeometryFromText('POLYGON((-0.00045 -0.00045, 0.00045
-0.00045, 0.00045 0.00045, -0.00045 0.00045, -0.00045 -0.00045))')) AS
perimeter;
+```
+```text
++-------------------+
+| perimeter |
++-------------------+
+| 400.3023642327689 |
++-------------------+
+```
+
+**Calculate the Circumference of a Circle (CIRCLE)**
+```sql
+-- Calculate the circumference of a circle with a radius of 100 meters
+SELECT ST_LENGTH(ST_Circle(0, 0, 100));
+```
+```text
++---------------------------------+
+| ST_LENGTH(ST_Circle(0, 0, 100)) |
++---------------------------------+
+| 628.3185307179587 |
++---------------------------------+
+```
+
+**Length of a Point**
+```sql
+SELECT ST_LENGTH(ST_GeometryFromText('POINT(1 1)'));
+```
+```text
++----------------------------------------------+
+| ST_LENGTH(ST_GeometryFromText('POINT(1 1)')) |
++----------------------------------------------+
+| 0 |
++----------------------------------------------+
+```
+
+**Invalid Parameter (Returns NULL)**
+```sql
+SELECT ST_LENGTH('NOT_A_GEOMETRY');
+```
+```text
++-----------------------------+
+| ST_LENGTH('NOT_A_GEOMETRY') |
++-----------------------------+
+| NULL |
++-----------------------------+
+```
+
+**NULL Parameter**
+```sql
+SELECT ST_LENGTH(NULL);
+```
+```text
++-----------------+
+| ST_LENGTH(NULL) |
++-----------------+
+| NULL |
++-----------------+
+```
+
+**Length of a Complex Line Object**
+```sql
+-- Calculate the total length of a polyline
+SELECT ST_LENGTH(ST_LineFromText("LINESTRING (0 0,1 0,1 1)"));
+```
+```text
++--------------------------------------------------------+
+| ST_LENGTH(ST_LineFromText("LINESTRING (0 0,1 0,1 1)")) |
++--------------------------------------------------------+
+| 222390.2023549679 |
++--------------------------------------------------------+
+```
\ No newline at end of file
diff --git a/versioned_sidebars/version-4.x-sidebars.json
b/versioned_sidebars/version-4.x-sidebars.json
index 4d755a264e8..7ea076107d2 100644
--- a/versioned_sidebars/version-4.x-sidebars.json
+++ b/versioned_sidebars/version-4.x-sidebars.json
@@ -1560,10 +1560,13 @@
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-circle",
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-contains",
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-disjoint",
+
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance",
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-distance-sphere",
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometryfromtext",
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometryfromwkb",
+
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-geometrytype",
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-intersects",
+
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-length",
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-linefromtext",
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-point",
"sql-manual/sql-functions/scalar-functions/spatial-functions/st-polygon",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]