# FreeBSD Manual Pages

geoLn(3) Geography C functions geoLn(3)NAMEGeoLn, GeoLnCreate, GeoLnClear, GeoLnSetAlloc, GeoLnAddPt, GeoLnInfo, GeoLnGetPt, GeoLnDestroy, GeoLnCtr, GeoLnContainGeoPt - container for geographic points.SYNOPSIS#include<geoLines.h>GeoLnGeoLnCreate(unsignednptsMax);voidGeoLnClear(GeoLngeoLn);voidGeoLnSetAlloc(GeoLngeoLn,unsignednptsMax);voidGeoLnDestroy(GeoLngeoLn);voidGeoLnAddPt(GeoPtgeoPt,GeoLngeoLn);structGeoLnInfoGeoLnGetInfo(GeoLngeoLn);GeoPtGeoLnGetPt(GeoLngeoLn,unsignedn);CartPtGeoLnCtr(GeoLnln);intGeoLnContainGeoPt(GeoPtgeoPt,GeoLngeoLn);DESCRIPTIONThese functions create, manipulate and access geolines, which are ar- rays of geographic points (see Geography(3)). Geolines are represented by objects of typeGeoLn.GeoLnCreatecreates and initializes a geoline with enough memory allo- cated to storenPtsMaxgeographic points. It returns the new geoline, or NULL if there is a failure. When no longer needed, the geoline should be destroyed with a call toGeoLnDestroy.GeoLnClearremoves all points fromgeoLn, but does not free it's stor- age. This reduces memory management overhead for geolines that are reused.GeoLnSetAllocsets the allocation ofgeoLntonPtsMax.GeoLnDestroyfrees all storage associated withgeoLn.GeoLnAddPtaddsgeoPtto the end ofgeoLn. It increasesgeoLn's allo- cation automatically, if necessary.GeoLnGetInforeturns a structure of form: struct GeoLnInfo { unsigned nPts; Angle latMax; Angle lonMax; Angle latMin; Angle lonMin; }; in whichnPtsis the number of points in thege-oLn,latMaxis the maximum longitude in Angle units,lonMaxis the max- imum latitude in Angle units,latMinis the minimum longitude in Angle units, andlonMinis the minimum latitude in Angle units. See thege-ography(3) man page for information on Angle units.GeoLnGetPtreturns the geographic point at offsetnfromgeoLn. The first point in the line has offset0.GeoLnGetPtreturnsGeoPt-Nowhere()ifnis out of bounds.GeoLnCtrreturns the "center of mass" ofgeoLnas a Cartesian point. A Cartesian point is a point on the globe described in a 3D Cartesian co- ordinate system with origin at the Earth's center and in which Earth has unit radius. It is represented by typeCartPtdeclared ingeogra-phy.has typedef struct { double x; double y; double z; } CartPt;GeoLnCtrconverts all of the geographic points ingeoLnto Cartesian points and then computes their mean in 3D space. This gives a rough measure of where the points are.GeoLnContainGeoPtreturns true ifgeoPtis contained withingeoLn. The algorithm assumes that the segments joining the points ingeoLnin or- der never cross and form a closed shape. The pole oppositegeoLn's center as computed byGeoLnCtris assumed to be outside this shape. If a segment connectinggeoPtto the far pole intersects the shape an odd number of times,geoPtis insidegeoLnandGeoLnContainGeoPtreturns true. Otherwise it returns false. Result is undefined and unreliable if any of the segments cross or ifgeoLn's center of mass is at the center of the Earth, such as if the line is a great circle.SEE ALSOgeoLnArr, mapLn, mapLnArr, geographyKEYWORDSGeoLn, geoline, geography, containerAUTHORGordon Carrie (user0@tkgeomap.org) Geography 2 geoLn(3)

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | KEYWORDS | AUTHOR

Want to link to this manual page? Use this URL:

<https://www.freebsd.org/cgi/man.cgi?query=geoLn&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>