safe.gis.geodesy module - 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


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

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

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

Very cheap and rough approximation to distance.

Parameters:P (Point) – A relative point
Return type:float

Bearing (in degrees) to point P.

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

Distance to point P.

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

Make a circle about this point.

  • 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)

list of lon, lat coordinates defining the circle

Return type:


The circle is defined in geographic coordinates so the distance in meters will be greater than the specified radius in the north south direction.

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