nvector.objects.GeoPoint

class 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.displace(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'
__init__(self, latitude, longitude, z=0, frame=None, degrees=False)[source][source]

x.__init__(…) initializes x; see help(type(x)) for signature

Methods

__init__(self, latitude, longitude[, z, …]) x.__init__(…) initializes x; see help(type(x)) for signature
delta_to(self, other) Return cartesian delta vector from positions A to B decomposed in N.
displace(self, distance, azimuth[, …]) Return position B computed from current position, distance and azimuth.
distance_and_azimuth(self, point[, …]) Return ellipsoidal distance between positions as well as the direction.
to_ecef_vector(self) Converts latitude and longitude to ECEF-vector.
to_geo_point(self) Return geo-point
to_nvector(self) Converts latitude and longitude to n-vector.

Attributes

latitude_deg
latlon
latlon_deg
longitude_deg