Perimeter

Supported in: Batch, Streaming

Calculates perimeter of a geometry in meters using a spherical approximation of the globe. For a line string or a point, this equals 0.

Expression categories: Geospatial

Declared arguments

  • Expression - GeoJSON string.
    Expression<Geometry>

Output type: Double

Examples

Example 1: Base case

Argument values:

  • Expression: geometry
geometryOutput
{"type":"Polygon","coordinates":[[[-102.05,41.0],[-109.05,41.0],[-109.05,37.0],[-102.05,37.0],[-102.05,41.0]]]}2098333.448556529

Example 2: Base case

Argument values:

  • Expression: geometry
geometryOutput
{"type":"MultiPolygon","coordinates":[[[[-102.05,41.0],[-109.05,41.0],[-109.05,37.0],[-102.05,37.0],[-102.05,41.0]]],[[[-1.0,-1.0],[1.0,-1.0],[1.0,1.0],[-1.0,1.0],[-1.0,-1.0]]]]}2987826.341349821

Example 3: Base case

Argument values:

  • Expression: geometry
geometryOutput
{"type":"Polygon","coordinates":[[[-1.0,-1.0],[1.0,-1.0],[1.0,1.0],[-1.0,1.0],[-1.0,-1.0]]]}889492.8927932923

Example 4: Null case

Argument values:

  • Expression: geometry
geometryOutput
nullnull

Example 5: Edge case

Argument values:

  • Expression: geometry
geometryOutput
not geoJsonnull

Example 6: Edge case

Argument values:

  • Expression: geometry
geometryOutput
{"type":"LineString","coordinates":[[0.0,0.0],[1.0,0.0]]}0.0

Example 7: Edge case

Argument values:

  • Expression: geometry
geometryOutput
{"type":"Point","coordinates":[0.0,0.0]}0.0

Example 8: Edge case

Argument values:

  • Expression: geometry
geometryOutput
{"type":"Polygon","coordinates":[[[-179.0,-1.0],[179.0,-1.0],[179.0,1.0],[-179.0,1.0],[-179.0,-1.0]]]}889492.8927932923