PostGIS  2.4.9dev-r@@SVN_REVISION@@
geography_centroid.c File Reference
#include "postgres.h"
#include "../postgis_config.h"
#include <math.h>
#include "liblwgeom.h"
#include "lwgeom_pg.h"
#include "lwgeom_transform.h"
Include dependency graph for geography_centroid.c:

Go to the source code of this file.

Functions

Datum geography_centroid (PG_FUNCTION_ARGS)
 
LWPOINTgeography_centroid_from_wpoints (const uint32_t srid, const POINT3DM *points, const uint32_t size)
 Convert lat-lon-points to x-y-z-coordinates, calculate a weighted average point and return lat-lon-coordinated. More...
 
LWPOINTgeography_centroid_from_mline (const LWMLINE *mline, SPHEROID *s)
 Split lines into segments and calculate with middle of segment as weighted point. More...
 
LWPOINTgeography_centroid_from_mpoly (const LWMPOLY *mpoly, bool use_spheroid, SPHEROID *s)
 Split polygons into triangles and use centroid of the triangle with the triangle area as weight to calculate the centroid of a (multi)polygon. More...
 
LWPOINTcart_to_lwpoint (const double_t x_sum, const double_t y_sum, const double_t z_sum, const double_t weight_sum, const uint32_t srid)
 
POINT3Dlonlat_to_cart (const double_t raw_lon, const double_t raw_lat)
 
 PG_FUNCTION_INFO_V1 (geography_centroid)
 geography_centroid(GSERIALIZED *g) returns centroid as point More...