safe.gis.geodesy module

point.py - Represents a generic point on a sphere as a Python object.

See documentation of class Point for details. Ole Nielsen, ANU 2002

class safe.gis.geodesy.Point(latitude=None, longitude=None)[source]

Bases: object

Definition of a generic point on the sphere.

Defines a point in terms of latitude and longitude and computes distances to other points on the sphere.

Initialise as
Point(lat, lon), where lat and lon are in decimal degrees (dd.dddd)
Public Methods:
distance_to(P) bearing_to(P) dist(P)

Author: Ole Nielsen, ANU 2002

AZ(P)[source]

Compute Azimuth bearing (AZ) from current point to P.

Parameters:P (Point) – A relative point
Returns:bearing in radians
Return type:float
GCA(P)[source]

Compute the Creat Circle Angle (GCA) between current point and P.

Parameters:P (Point) – A relative point
Returns:angle in radians
Return type:float
R = 6372000
approximate_distance_to(P)[source]

Very cheap and rough approximation to distance.

Parameters:P (Point) – A relative point
Returns:distance
Return type:float
bearing_to(P)[source]

Bearing (in degrees) to point P.

Parameters:P (Point) – A relative point
Returns:bearing degrees
Return type:int
degrees2radians = 0.017453292519943295
distance_to(P)[source]

Distance to point P.

Parameters:P (Point) – A relative point
Returns:distance
Return type:float
generate_circle(radius, resolution=1)[source]

Make a circle about this point.

Parameters:
  • radius (float, int) – The desired cirle radius [m]
  • resolution (int, float) – Radial distance (degrees) between points on circle. Default is 1 making the circle consist of 360 points. (optional)
Returns:

list of lon, lat coordinates defining the circle

Return type:

list

..note::
The circle is defined in geographic coordinates so the distance in meters will be greater than the specified radius in the north south direction.
safe.gis.geodesy.acos(c)[source]

acos - Safe inverse cosine

Parameters:c (float) – This value is shrunk to admissible interval to avoid case where a small rounding error causes a math domain error.
Returns:Arcos of the parameter c.
Return type:float