Skip to content

Instantly share code, notes, and snippets.

-- PostGIS functions which will create an pollygon representing an ellipse using the "Pins and String" method
--
-- https://en.wikipedia.org/wiki/Ellipse#Pins-and-string_method
--
-- Usage: ST_Ellipse(LINESTRING, DISTANCE, NUMBER OF NODES);
-- Usage: ST_Ellipse(LINESTRING, DISTANCE); -- defaults to 8 nodes
--
-- Args:
-- LINESTRING -- A two point linestring. Use ST_MakeLine(p1,p2) if you have two points