I have a list of lines and I want to create a polygon from them using PostgreSQL. I can't find a function that gets a list or an array of lines and returns a polygon.
For example I have the following lines:
SELECT 'LINESTRING(12.50226 41.900927,12.076105 41.949897)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.900927,12.0974 41.9967)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.90093,12.0644 41.953876)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.90093,12.0644 41.953876)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.900927,12.076105 41.949897)' AS WKT UNION ALL
SELECT 'LINESTRING(12.50226 41.900927,12.0974 41.9967)' AS WKT UNION ALL
SELECT 'LINESTRING(12.507033 41.896497,12.076105 41.949897)' AS WKT UNION ALL
SELECT 'LINESTRING(12.507033 41.896497,12.076105 41.949897)' AS WKT
My main goal is to create a corridor from group of lines. I think the best way to do it is to create a polygon.
Is there a better way, if not, how can I create it using PostGIS?
The following picture is the lines: