CreateLineString

 

Updated: March 22, 2017

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)  

Points

A list of GeoJSON record points.

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

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

Input Example

latitudelongitude
3.0-10.2
-87.3320.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] ]}

Show: