API Reference Geocalc v0.8.4

Modules

Calculate distance, bearing and more between Latitude/Longitude points.

The Geocalc.DMS is a struct which contains degrees, minutes, seconds and cardinal direction. Also have functions to convert DMS to decimal degrees.

The Geocalc.Point protocol is responsible for receiving latitude and longitude from any Elixir data structure. At this time it have implementations only for Map, Tuple and List, and Shape defined inside this project. Point values can be decimal degrees or DMS (degrees, minutes, seconds).

Geocalc.Shape contains Circle, Rectangle and Ellipse shapes. Those shapes define a geographical area projection and are designed to be used for geofencing, ie: the user can determine if one point is inside or outside a geographical zone. Geographical zones are defined with a center point and several spatial dimensions (see each shape documentation)

Circle describes a circular geographical area, centered on latitude, longitude, with a radius in meters. latitude and longitude could be decimal degrees or Geocalc.DMS.

Ellipse describes an elliptic geographical area, centered on latitude, longitude (could be decimal degrees or Geocalc.DMS), with long_semi_axis and short_semi_axis (both in meters) and an azimuth angle (in degrees). long_semi_axis is the length of the longest diameter, also called semi-major axis. short_semi_axis is the length of the shortest diameter, also called semi-minor axis. angle is the azimuth angle of the long semi-axis.

Rectangle describes a rectangular geographical area, centered on latitude, longitude (could be decimal degrees or Geocalc.DMS), with long_semi_axis and short_semi_axis (both in meters) and an azimuth angle (in degrees). long_semi_axis is the distance between the center point and the short side of the rectangle. short_semi_axis is the distance between the center point and the long side of the rectangle. angle is the azimuth angle of the long side of the rectangle, ie: the angle between north and long_semi_axis.