CreateLineString (Azure Stream Analytics)

Returns a GeoJSON LineString record. The result of a CreateLineString can be used as input to other Geospatial functions.

Be aware that when declaring LineStrings:

  • A LineStrings must have at least 2 points.

  • The structure cannot overlap itself over an interval of two or more consecutive points.

Syntax

CreateLineString (points)  

Argument

Points

A list of GeoJSON record points.

Return Type

Returns a GeoJSON LineString record with LineString as type and an arrays of points as coordinates.

Example

SELECT  
     CreateLineString(CreatePoint(input.latitude, input.longitude), CreatePoint(10.0, 10.0), CreatePoint(10.5, 10.5))  
FROM input  
  

Input Example

latitude longitude
3.0 -10.2
-87.33 20.2321

Output Example

{"type" : "LineString", "coordinates" : [ [-10.2, 3.0], [10.0, 10.0], [10.5, 10.5] ]}

{"type" : "LineString", "coordinates" : [ [20.2321, -87.33], [10.0, 10.0], [10.5, 10.5] ]}

See Also