Convert linestring to polygon(将线串转换为多边形(Convert linestring to polygon))¶
Supported in: Batch, Faster, Streaming
Convert a linestring geometry to a polygon geometry. This expression assumes the linestring geometry is closed. If not, the expression will return null.
Expression categories: Geospatial
Declared arguments¶
- Expression: A valid linestring geometry.
Expression\
Output type: Geometry
Examples¶
Example 1: Base case¶
Argument values:
- Expression:
polygon_points
| polygon_points | Output |
|---|---|
| {"type":"LineString","coordinates":[[-77.49,38.01],[-77.47,38.15],[-77.19,38.14],[-77.49,38.01]]} | {"type":"Polygon","coordinates":[[[-77.49,38.01],[-77.47,38.15],[-77.19,38.14],[-77.49,38.01]]]} |
Example 2: Null case¶
Argument values:
- Expression:
polygon_points
| polygon_points | Output |
|---|---|
| null | null |
| {"type":"LineString","coordinates":[[-77.49,38.01],[-77.19,38.14],[-77.49,38.01]]} | null |
| {"type":"LineString","coordinates":[[-77.49,38.01],[-77.19,38.14]]} | null |
| {"type":"LineString","coordinates":[[-77.49,38.01]]} | null |
| {"type":"Polygon","coordinates":[[[-77.49,38.01],[-77.47,38.15],[-77.19,38.14],[-77.49,38.01]]]} | null |
中文翻译¶
将线串转换为多边形(Convert linestring to polygon)¶
支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)
将线串几何图形转换为多边形几何图形。此表达式假定线串几何图形是闭合的。若非闭合,表达式将返回空值。
表达式类别: 地理空间(Geospatial)
声明的参数¶
- 表达式(Expression): 一个有效的线串几何图形。
表达式\
输出类型: Geometry
示例¶
示例 1:基本情况¶
参数值:
- 表达式:
polygon_points
| polygon_points | 输出 |
|---|---|
| {"type":"LineString","coordinates":[[-77.49,38.01],[-77.47,38.15],[-77.19,38.14],[-77.49,38.01]]} | {"type":"Polygon","coordinates":[[[-77.49,38.01],[-77.47,38.15],[-77.19,38.14],[-77.49,38.01]]]} |
示例 2:空值情况¶
参数值:
- 表达式:
polygon_points
| polygon_points | 输出 |
|---|---|
| null | null |
| {"type":"LineString","coordinates":[[-77.49,38.01],[-77.19,38.14],[-77.49,38.01]]} | null |
| {"type":"LineString","coordinates":[[-77.49,38.01],[-77.19,38.14]]} | null |
| {"type":"LineString","coordinates":[[-77.49,38.01]]} | null |
| {"type":"Polygon","coordinates":[[[-77.49,38.01],[-77.47,38.15],[-77.19,38.14],[-77.49,38.01]]]} | null |