跳转至

Get the convex hull of a geometry(获取几何体的凸包(convex hull))

Supported in: Batch, Faster, Streaming

Given a valid GeoJSON input string, return a GeoJSON string that is the convex hull for the geometry. The convex hull is the smallest convex polygon containing the geometry.

Expression categories: Geospatial

Declared arguments

  • Expression: GeoJSON values for which the convex hull is calculated.
    Expression\

Output type: Geometry

Examples

Example 1: Base case

Argument values:

  • Expression: geometry
geometry Output
{"type":"Polygon","coordinates":[[[0.0,0.0],[2.0,0.0],[2.0,1.0],[1.0,1.0],[1.0,2.0],[0.0,2.0],[0.0,0.0]]]} {"type":"Polygon", "coordinates":[[[0.0, 0.0], [0.0, 2.0], [1.0, 2.0], [2.0, 1.0], [2.0, 0.0], [0.0, 0.0]]]}
null null

Example 2: Base case

Argument values:

  • Expression: geometry
geometry Output
{"type":"Polygon","coordinates":[[[0.0,0.0],[1.0,0.0],[0.0,1.0],[0.0,0.0]]]} {"type":"Polygon","coordinates":[[[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [0.0, 0.0]]]}

Example 3: Base case

Argument values:

  • Expression: geometry
geometry Output
{"type":"MultiPolygon","coordinates":[[[[0.0,0.0],[1.0,0.0],[1.0,1.0],[0.0,1.0],[0.0,0.0]]],[[[2.0,0.0],[3.0,0.0],[3.0,1.0],[2.0,1.0],[2.0,0.0]]]]} {"type":"Polygon", "coordinates":[[[0.0, 0.0], [0.0, 1.0], [3.0, 1.0], [3.0, 0.0],[0.0, 0.0]]]}

Example 4: Base case

Argument values:

  • Expression: geometry
geometry Output
{"type":"MultiPoint","coordinates":[[0.0,0.0],[0.0,1.0],[2.0,0.0], [2.0,1.0]]} {"type":"Polygon","coordinates":[[[0.0, 0.0], [0.0, 1.0], [2.0, 1.0], [2.0, 0.0], [0.0, 0.0]]]}


中文翻译


获取几何体的凸包(convex hull)

支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)

给定一个有效的 GeoJSON 输入字符串,返回该几何体的凸包(convex hull)对应的 GeoJSON 字符串。凸包是包含该几何体的最小凸多边形。

表达式类别: 地理空间(Geospatial)

声明的参数

  • 表达式(Expression): 用于计算凸包的 GeoJSON 值。
    表达式\

输出类型: Geometry

示例

示例 1:基础情况

参数值:

  • 表达式: geometry
geometry 输出
{"type":"Polygon","coordinates":[[[0.0,0.0],[2.0,0.0],[2.0,1.0],[1.0,1.0],[1.0,2.0],[0.0,2.0],[0.0,0.0]]]} {"type":"Polygon", "coordinates":[[[0.0, 0.0], [0.0, 2.0], [1.0, 2.0], [2.0, 1.0], [2.0, 0.0], [0.0, 0.0]]]}
null null

示例 2:基础情况

参数值:

  • 表达式: geometry
geometry 输出
{"type":"Polygon","coordinates":[[[0.0,0.0],[1.0,0.0],[0.0,1.0],[0.0,0.0]]]} {"type":"Polygon","coordinates":[[[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [0.0, 0.0]]]}

示例 3:基础情况

参数值:

  • 表达式: geometry
geometry 输出
{"type":"MultiPolygon","coordinates":[[[[0.0,0.0],[1.0,0.0],[1.0,1.0],[0.0,1.0],[0.0,0.0]]],[[[2.0,0.0],[3.0,0.0],[3.0,1.0],[2.0,1.0],[2.0,0.0]]]]} {"type":"Polygon", "coordinates":[[[0.0, 0.0], [0.0, 1.0], [3.0, 1.0], [3.0, 0.0],[0.0, 0.0]]]}

示例 4:基础情况

参数值:

  • 表达式: geometry
geometry 输出
{"type":"MultiPoint","coordinates":[[0.0,0.0],[0.0,1.0],[2.0,0.0], [2.0,1.0]]} {"type":"Polygon","coordinates":[[[0.0, 0.0], [0.0, 1.0], [2.0, 1.0], [2.0, 0.0], [0.0, 0.0]]]}