跳转至

Geometry length(几何长度(Geometry length))

Supported in: Batch, Streaming

Get the length of the line strings and multi line strings in the geometry in meters. Uses a spherical approximation of the globe. Non-linear geometries (polygons and points) count as 0.

Expression categories: Geospatial

Declared arguments

  • Expression: GeoJSON string.
    Expression\

Output type: Double

Examples

Example 1: Base case

Argument values:

  • Expression: geometry
geometry Output
{"type":"LineString","coordinates":[[-73.778128,40.641195],[-118.408535,33.941563]]} 3974344.7433354934
{"type":"LineString","coordinates":[[0.0,0.0],[1.0,0.0],[1.0,1.0],[1.0,2.0]]} 333585.2407005987
{"type":"MultiLineString","coordinates":[[[0.0,0.0],[1.0,0.0],[1.0,1.0]], [[1.0,2.0],[2.0,2.0]]]} 333517.50194413937

Example 2: Null case

Argument values:

  • Expression: geometry
geometry Output
null null

Example 3: Edge case

Argument values:

  • Expression: geometry
geometry Output
{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[-1.0,-1.0],[-3.0,-1.0]... 333517.50194413937
{"type":"Polygon","coordinates":[[[-1.0,-1.0],[-3.0,-1.0],[-2.0,-2.0],[-1.0,-1.0]]]} 0.0
{"type":"MultiPoint","coordinates":[[23.0,30.0],[12.0,15.3]]} 0.0


中文翻译

几何长度(Geometry length)

支持:批量处理(Batch)、流处理(Streaming)

以米为单位获取几何图形中线段和多线段的长度。采用球面近似计算地球。非线状几何图形(多边形和点)计为0。

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

声明的参数

  • 表达式(Expression): GeoJSON字符串。
    表达式\

输出类型: Double

示例

示例1:基本情况

参数值:

  • 表达式(Expression): geometry
geometry 输出(Output)
{"type":"LineString","coordinates":[[-73.778128,40.641195],[-118.408535,33.941563]]} 3974344.7433354934
{"type":"LineString","coordinates":[[0.0,0.0],[1.0,0.0],[1.0,1.0],[1.0,2.0]]} 333585.2407005987
{"type":"MultiLineString","coordinates":[[[0.0,0.0],[1.0,0.0],[1.0,1.0]], [[1.0,2.0],[2.0,2.0]]]} 333517.50194413937

示例2:空值情况

参数值:

  • 表达式(Expression): geometry
geometry 输出(Output)
null null

示例3:边界情况

参数值:

  • 表达式(Expression): geometry
geometry 输出(Output)
{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[-1.0,-1.0],[-3.0,-1.0]... 333517.50194413937
{"type":"Polygon","coordinates":[[[-1.0,-1.0],[-3.0,-1.0],[-2.0,-2.0],[-1.0,-1.0]]]} 0.0
{"type":"MultiPoint","coordinates":[[23.0,30.0],[12.0,15.3]]} 0.0