May 2017
Beginner to intermediate
328 pages
7h 17m
English
A function for composing polygons is not-so-surprisingly named ST_MakePolygon. For a solid polygon without holes, it accepts one argument-a closed LineString.
SELECT ST_MakePolygon(ST_MakeLine(ARRAY[ST_MakePoint(20,50), ST_MakePoint(19.95,49.98), ST_MakePoint(19.90,49.90),ST_MakePoint(20,50)]));
SELECT ST_MakePolygon(ST_MakeLine(ARRAY[ST_MakePoint(20,50), ST_MakePoint(19.95,49.98), ST_MakePoint(19.90,49.96)])); ERROR: lwpoly_from_lwlines: shell must have at least 4 points
And if a ring is not closed:
SELECT ST_MakePolygon(ST_MakeLine(ARRAY[ST_MakePoint(20,50), ...Read now
Unlock full access