[GIS] Making ellipse geometry from some known parameters using PostGIS

ellipsoidgeopypostgispython

How to create an ellipse geometry with postgis from known axis coordinates and peak radius ?

From picture below :

enter image description here

Point A and Point B is known lat/lon

R is a known result of fresnelZone calculation (in Meters).

Yes I read this and this (using shapely instead of Postgis), but I don't know how to implement/adopt it to my need.

Best Answer

I would go with CIRCULARSTRING. You already know the coordinates of start point and end point, and the coordinates for the peak radius can be easily calculated.

Thus, the half of your desired ellipse could be represented as

CIRCULARSTRING(StartPointX StartPointY, PeakRadiusX PeakRadiusY, EndPointX EndPointY)

The other half being the same with negative values of peak radius

    CIRCULARSTRING(StartPointX StartPointY, -PeakRadiusX -PeakRadiusY, EndPointX EndPointY)

Union those two halfs and you should have your ellipse complete.