Definition at line 1683 of file liblwgeom/lwgeom_geos.c.
1684{
1686 double area;
1687 uint32_t i;
1689
1691 {
1692 lwerror(
"%s: only multipolygons supported", __func__);
1693 return NULL;
1694 }
1696
1698
1699 for (i = 0; i < lwmpoly->
ngeoms; i++)
1700 {
1702 int sub_npoints = lround(npoints * sub_area / area);
1703 if (sub_npoints > 0)
1704 {
1706 if (!mpt)
1707 mpt = sub_mpt;
1708 else
1709 {
1710 uint32_t j;
1711 for (j = 0; j < sub_mpt->
ngeoms; j++)
1713
1714
1717 }
1718 }
1719 }
1720 return mpt;
1721}
LWMPOINT * lwpoly_to_points(const LWPOLY *lwpoly, uint32_t npoints, int32_t seed)
LWMPOINT * lwmpoint_add_lwpoint(LWMPOINT *mobj, const LWPOINT *obj)
double lwgeom_area(const LWGEOM *geom)
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
double lwpoly_area(const LWPOLY *poly)
Find the area of the outer ring - sum (area of inner rings).
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
References LWMPOINT::geoms, LWMPOLY::geoms, lwerror(), lwfree(), lwgeom_area(), lwgeom_get_type(), lwgeom_is_empty(), lwgeom_release(), lwmpoint_add_lwpoint(), lwpoly_area(), lwpoly_to_points(), MULTIPOLYGONTYPE, LWMPOINT::ngeoms, and LWMPOLY::ngeoms.
Referenced by lwgeom_to_points().