Socrata was acquired by Tyler Technologies in 2018 and is now the Data and Insights division of Tyler. The platform is still powered by the same software formerly known as Socrata but you will see references to Data & Insights going forward.

# to_multiline

##### Function: to_multiline
  convert a line into a multiline

parse a WKT (text) representation of a multiline into a multiline value

Examples:

to_multiline(to_line('LINESTRING (30 10, 10 30, 40 40)'))
-- Result: {"type":"MultiLineString","coordinates":[[[30,10],[10,30],[40,40]]]}

to_multiline(to_line('LINESTRING (30 10)'))
-- Result: {"type":"invalid_geometry","english":"Geometry invariant violation: LineString must have at least 2 coordinates","data":{"value":{"type":"LineString","coordinates":[[30,10]]},"reason":"LineString must have at least 2 coordinates"}}

to_multiline('MULTILINESTRING ((10 10, 20 20, 10 40),(40 40, 30 30, 40 20, 30 10))')
-- Result: {"type":"MultiLineString","coordinates":[[[10,10],[20,20],[10,40]],[[40,40],[30,30],[40,20],[30,10]]]}

to_multiline(a_wkt_multiline)
-- Result: {"type":"MultiLineString","coordinates":[[[10,10],[20,20],[10,40]],[[40,40],[30,30],[40,20],[30,10]]]}

to_multiline('MULTILINESTRING ((10 10),(40 40, 30 30, 40 20, 30 10))')
-- Result: {"type":"invalid_geometry","english":"Geometry invariant violation: LineString must have at least 2 coordinates","data":{"value":{"type":"MultiLineString","coordinates":[[[10,10]],[[40,40],[30,30],[40,20],[30,10]]]},"reason":"LineString must have at least 2 coordinates"}}


###### Signatures
line -> multiline
text -> multiline
multiline -> multiline