PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ centroid()

Datum centroid ( PG_FUNCTION_ARGS  )

Definition at line 1485 of file postgis/lwgeom_geos.c.

1486{
1487 GSERIALIZED *geom, *result;
1488 LWGEOM *lwgeom, *lwresult;
1489
1490 geom = PG_GETARG_GSERIALIZED_P(0);
1491
1492 lwgeom = lwgeom_from_gserialized(geom);
1493 lwresult = lwgeom_centroid(lwgeom);
1494 lwgeom_free(lwgeom);
1495 PG_FREE_IF_COPY(geom, 0);
1496
1497 if (!lwresult) PG_RETURN_NULL();
1498
1499 result = geometry_serialize(lwresult);
1500 lwgeom_free(lwresult);
1501 PG_RETURN_POINTER(result);
1502}
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition cu_print.c:267
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
LWGEOM * lwgeom_centroid(const LWGEOM *geom)

References lwgeom_centroid(), lwgeom_free(), lwgeom_from_gserialized(), and result.

Referenced by getOctant(), getOctant(), getQuadrant4D(), gserialized_spgist_choose_2d(), gserialized_spgist_choose_3d(), gserialized_spgist_choose_nd(), gserialized_spgist_inner_consistent_2d(), gserialized_spgist_inner_consistent_3d(), gserialized_spgist_inner_consistent_nd(), gserialized_spgist_picksplit_2d(), gserialized_spgist_picksplit_3d(), gserialized_spgist_picksplit_nd(), lwgeom_cluster_kmeans(), nextCubeBox(), nextCubeBox3D(), and nextRectBox().

Here is the call graph for this function:
Here is the caller graph for this function: