I Need help graphing this ellipse of a track with lat and long in jupyter notebo
ID: 3871199 • Letter: I
Question
I Need help graphing this ellipse of a track with lat and long in jupyter notebook python pandas but it won't seem to work. the points I have Start off at -73.4752382500000 44.6842320426984. From here, it travels along the ellipse 0.505527519677847 (x+73.4756465)^2+(y- 44.684205998999)^2 = 8.493356647387610E-08 to the point -73.4760547500000 44.6841799553015. tthen it progresses in a straight line to -73.4759422500000 44.6832884563015. From here, it travels along the ellipse 0.505527519677847 (x+73.475534 )^2+(y- 44.6833145 )^2 = 8.493356647387610E-08 to the point -73.47512575 44.6833405436984. finally it travels along a straight line to the initial point.
Explanation / Answer
from django.contrib.gis.geos import MultiPolygon
from shapely.ops import transform
from shapely.affinity import translate
from django.contrib.gis.geos import GEOSGeometry
import pyproj
from functools import partial
latitude = -73.4752382500000
longitude = 44.6842320426984
maj = 13.11 #Nmi
min = 8.49 #Nmi
meterconversion = 1852
smajmeters = (maj * meterconversion) / 2 #major meters
sminmeters = (min * meterconversion) / 2 #minor meters
orientation = 62 #Degree Rotation
#Parameters of ellipse
ellipse = ((0, 0), (smajmeters, sminmeters), orientation)
#creating a circle or radius=1
circle = shapely.geometry.Point(ellipse[0]).buffer(1))
#creating ellipse along x, y
ellipse = shapely.affinity.scale(circ, int(ellipse[0][1]), int(ellipse[1][1]))
#Rotating the ellipse
elrotate = shapely.affinity.rotate(ellipse, 90 + (ellipse[2] * -1))
pyproj.Proj(init='epsg:4326'))
projection = partial(pyproj.transform, pyproj.Proj(init='epsg:3857'),
geo4326 = transform(project, elrotate)
transgeometry= shapely.affinity.translate(geo4326, longitude, latitude)
ellpolygon = GEOSGeometry(transgeom.wkt)
ellpolygon.srid = 4325
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.