Documentation
¶
Overview ¶
Package geographiclib is a wrapper around the GeographicLib library.
Index ¶
- Variables
- type Spheroid
- func (s *Spheroid) AreaAndPerimeter(points []s2.Point) (area float64, perimeter float64)
- func (s *Spheroid) Inverse(a, b s2.LatLng) (s12, az1, az2 float64)
- func (s *Spheroid) InverseBatch(points []s2.Point) float64
- func (s *Spheroid) Project(point s2.LatLng, distance float64, azimuth s1.Angle) s2.LatLng
Constants ¶
This section is empty.
Variables ¶
var ( // WGS84Spheroid represents the default WGS84 ellipsoid. WGS84Spheroid = NewSpheroid(6378137, 1/298.257223563) )
Functions ¶
This section is empty.
Types ¶
type Spheroid ¶
type Spheroid struct { Radius float64 Flattening float64 SphereRadius float64 // contains filtered or unexported fields }
Spheroid is an object that can perform geodesic operations on a given spheroid.
func NewSpheroid ¶
NewSpheroid creates a spheroid from a radius and flattening.
func (*Spheroid) AreaAndPerimeter ¶
AreaAndPerimeter computes the area and perimeter of a polygon on a given spheroid. The points must never be duplicated (i.e. do not include the "final" point of a Polygon LinearRing). Area is in meter^2, Perimeter is in meters.
func (*Spheroid) Inverse ¶
Inverse solves the geodetic inverse problem on the given spheroid (https://en.wikipedia.org/wiki/Geodesy#Geodetic_problems). Returns s12 (distance in meters), az1 (azimuth at point 1) and az2 (azimuth at point 2).
func (*Spheroid) InverseBatch ¶
InverseBatch computes the sum of the length of the lines represented by the line of points. This is intended for use for LineStrings. LinearRings/Polygons should use "AreaAndPerimeter". Returns the sum of the s12 (distance in meters) units.