nvector.objects.GeoPoint¶
-
class
nvector.objects.
GeoPoint
(latitude, longitude, z=0, frame=None, degrees=False)[source][source]¶ Geographical position given as latitude, longitude, depth in frame E
Parameters: latitude, longitude: real scalars or vectors of length n.
Geodetic latitude and longitude given in [rad or deg]
z: real scalar or vector of length n.
Depth(s) [m] relative to the ellipsoid (depth = -height)
frame: FrameE object
reference ellipsoid. The default ellipsoid model used is WGS84, but other ellipsoids/spheres might be specified.
degrees: bool
True if input are given in degrees otherwise radians are assumed.
Examples
Solve geodesic problems.
The following illustrates its use
>>> import nvector as nv >>> wgs84 = nv.FrameE(name='WGS84')
The geodesic inverse problem
>>> positionA = wgs84.GeoPoint(-41.32, 174.81, degrees=True) >>> positionB = wgs84.GeoPoint(40.96, -5.50, degrees=True) >>> s12, az1, az2 = positionA.distance_and_azimuth(positionB, degrees=True) >>> 's12 = {:5.2f}, az1 = {:5.2f}, az2 = {:5.2f}'.format(s12, az1, az2) 's12 = 19959679.27, az1 = 161.07, az2 = 18.83'
The geodesic direct problem
>>> positionA = wgs84.GeoPoint(40.6, -73.8, degrees=True) >>> az1, distance = 45, 10000e3 >>> positionB, az2 = positionA.geo_point(distance, az1, degrees=True) >>> lat2, lon2 = positionB.latitude_deg, positionB.longitude_deg >>> msg = 'lat2 = {:5.2f}, lon2 = {:5.2f}, az2 = {:5.2f}' >>> msg.format(lat2, lon2, az2) 'lat2 = 32.64, lon2 = 49.01, az2 = 140.37'
Methods
__init__
(latitude, longitude[, z, frame, ...])distance_and_azimuth
(point[, long_unroll, ...])Return ellipsoidal distance between positions as well as the direction. geo_point
(distance, azimuth[, long_unroll, ...])Return position B computed from current position, distance and azimuth. to_ecef_vector
()Converts latitude and longitude to ECEF-vector. to_geo_point
()Return geo-point to_nvector
()Converts latitude and longitude to n-vector. Attributes
latitude_deg
longitude_deg