Supported in: Batch
Given a column of GeoPoints and an ordering, return either a polygon or a line string by connecting the GeoPoints in the specified order. This function assumes that the data is tabular, with a single row representing an individual GeoPoint in a line string or in the shell of a polygon, along with a column specifying the order of those points. For a polygon this ordering should identify the points as you move counter-clockwise around the shell. Given an ordering of these points and a partition (grouping), the function constructs the required geometry for that partition by joining the GeoPoints in ascending order of the order-by column.
Expression categories: Geospatial
Output type: Geometry
Argument values:
geo_point
order
LINE_STRING
Given input table:
geo_point | order |
---|---|
{ latitude -> 0.0, longitude -> 0.0, } | 0 |
{ latitude -> 1.0, longitude -> 0.0, } | 1 |
{ latitude -> 1.0, longitude -> 1.0, } | 2 |
Outputs: {"type":"LineString","coordinates": [[0.0,0.0],[0.0, 1.0],[1.0,1.0]]}
Argument values:
geo_point
order
POLYGON
Given input table:
geo_point | order |
---|---|
{ latitude -> 0.0, longitude -> 0.0, } | 0 |
{ latitude -> 1.0, longitude -> 0.0, } | 3 |
{ latitude -> 1.0, longitude -> 1.0, } | 2 |
{ latitude -> 0.0, longitude -> 0.0, } | 4 |
{ latitude -> 0.0, longitude -> 1.0, } | 1 |
Outputs: {"type":"Polygon","coordinates": [[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]]]}
Argument values:
geo_point
order
LINE_STRING
Given input table:
geo_point | order |
---|---|
{ latitude -> 0.0, longitude -> 0.0, } | 0.0 |
null | 1.0 |
null | 2.0 |
{ latitude -> 0.0, longitude -> 1.0, } | 2.0 |
Outputs: {"type":"LineString","coordinates": [[0.0,0.0],[1.0, 0.0]]}
Argument values:
geo_point
order
LINE_STRING
Given input table:
geo_point | order |
---|---|
{ latitude -> 0.0, longitude -> 0.0, } | 0.0 |
Outputs: null
Argument values:
geo_point
order
POLYGON
Given input table:
geo_point | order |
---|---|
{ latitude -> 0.0, longitude -> 0.0, } | 0 |
{ latitude -> 1.0, longitude -> 1.0, } | 2 |
{ latitude -> 1.0, longitude -> 0.0, } | 3 |
{ latitude -> 0.0, longitude -> 1.0, } | 1 |
Outputs: {"type":"Polygon","coordinates": [[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]]]}
Argument values:
geo_point
order
POLYGON
Given input table:
geo_point | order |
---|---|
{ latitude -> 0.0, longitude -> 0.0, } | 0 |
{ latitude -> 1.0, longitude -> 0.0, } | 1 |
Outputs: null
Argument values:
geo_point
order
POLYGON
Given input table:
geo_point | order |
---|---|
null | 0 |
Outputs: null
Argument values:
geo_point
order
LINE_STRING
Given input table:
geo_point | order |
---|---|
{ latitude -> 0.0, longitude -> 0.0, } | 0 |
{ latitude -> 1.0, longitude -> 1.0, } | null |
{ latitude -> 1.0, longitude -> 0.0, } | 1 |
Outputs: {"type":"LineString","coordinates": [[0.0,0.0],[0.0, 1.0]]}