You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to do multiple calculations, and am finding I want to use more than one LatLon class (ie the ones from 'geodesy/latlon-nvector-ellipsoidal.js' and 'geodesy/latlon-ellipsoidal-vincenty.js'). What's the best way to go about doing this?
importLatLonNVectorfrom'geodesy/latlon-nvector-ellipsoidal.js';importLatLonVincentyfrom'geodesy/latlon-ellipsoidal-vincenty.js'// do I have to do this twice?constpoint1a=newLatLonNVector(52.205,0.119);constpoint1b=newLatLonVincenty(52.205,0.119);constpoint2a=newLatLonNVector(30,0.5)constpoint2b=newLatLonVincenty(30,0.5)// Would this accept a Vincenty point? Why doesn't it just take coordinates?constdelta=point1a.deltaTo(point2a)// I used the NVector one accidentally, will this work, or fail? Are the LatLon types different, or interchangeable?constdistance=point1b.distanceTo(point2a)
Is there a reason the scripts are organized as they are? It kind of seems like there should just be a set of different functions, instead of different LatLon classes, since they only take coordinates and height anyway...
For example it could be like this:
import{getDistance,getDelta}from'geodesy/ellipsoidal'// points are simply coordinates, optional height parameterconstpoint1=[52.205,0.119];constpoint2=[30,0.5];// functions operate on pointsconstdistance=getDistance(point1,point2);constdelta=getDelta(point1,point2);
The text was updated successfully, but these errors were encountered:
I'm trying to do multiple calculations, and am finding I want to use more than one LatLon class (ie the ones from
'geodesy/latlon-nvector-ellipsoidal.js'
and'geodesy/latlon-ellipsoidal-vincenty.js'
). What's the best way to go about doing this?Is there a reason the scripts are organized as they are? It kind of seems like there should just be a set of different functions, instead of different LatLon classes, since they only take coordinates and height anyway...
For example it could be like this:
The text was updated successfully, but these errors were encountered: