nvector.objects.GeoPoint¶
-
class
GeoPoint
(latitude, longitude, z=0, frame=None, degrees=False)[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') >>> point_a = wgs84.GeoPoint(-41.32, 174.81, degrees=True) >>> point_b = wgs84.GeoPoint(40.96, -5.50, degrees=True)
>>> print(point_a) GeoPoint(latitude=-0.721170046924057, longitude=3.0510100654112877, z=0, frame=FrameE(a=6378137.0, f=0.0033528106647474805, name='WGS84', R_Ee=[[0.0, 0.0, 1.0], [0.0, 1.0, 0.0], [-1.0, 0.0, 0.0]]))
The geodesic inverse problem
>>> s12, az1, az2 = point_a.distance_and_azimuth(point_b, 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
>>> point_a = wgs84.GeoPoint(40.6, -73.8, degrees=True) >>> az1, distance = 45, 10000e3 >>> point_b, az2 = point_a.displace(distance, az1, degrees=True) >>> lat2, lon2 = point_b.latitude_deg, point_b.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]¶ 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)Returns cartesian delta vector from positions a to b decomposed in N. displace
(self, distance, azimuth[, …])Returns position b computed from current position, distance and azimuth. distance_and_azimuth
(self, point[, …])Returns ellipsoidal distance between positions as well as the direction. to_ecef_vector
(self)Returns position as ECEFvector object. to_geo_point
(self)Returns position as GeoPoint object. to_nvector
(self)Returns position as Nvector object. Attributes
latitude_deg
latitude in degrees. latlon
(latitude, longitude, z) tuple, angles are in radian. latlon_deg
(latitude_deg, longitude_deg, z) tuple, angles are in degree. longitude_deg
longitude in degrees.