> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_LineFromText, ST_LineStringFromText

> 将 WKT（Well Known Text）转换为 Line 形式的内存表现形式。

从 WKT 解析 `LINESTRING`。

## 语法

```sql theme={null}
VARCHAR ST_LineFromText(VARCHAR wkt)
VARCHAR ST_LineStringFromText(VARCHAR wkt)
```

## 参数说明

`wkt`: 待转化的 WKT，支持的数据类型为 VARCHAR。

## 返回值说明

返回 `VARCHAR` 类型的旧版几何编码。使用 [ST\_AsText](/documents/cn/4.2/sql-reference/sql-functions/spatial-functions/st_astext.md) 可将其转换成可读的 WKT。

## 示例

```Plain Text theme={null}
MySQL > SELECT ST_AsText(ST_LineFromText("LINESTRING (1 1, 2 2)"));
+---------------------------------------------------------+
| st_astext(st_linefromtext('LINESTRING (1 1, 2 2)'))     |
+---------------------------------------------------------+
| LINESTRING (1 1, 2 2)                                   |
+---------------------------------------------------------+
```

## 相关数据类型

[VARCHAR](/documents/cn/4.2/sql-reference/data-types/string-type/VARCHAR.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.