Definition at line 1626 of file liblwgeom/lwgeom_geos.c.
1627{
1629 double area;
1630 uint32_t i;
1632
1634 {
1635 lwerror(
"%s: only multipolygons supported", __func__);
1636 return NULL;
1637 }
1639
1641
1642 for (i = 0; i < lwmpoly->
ngeoms; i++)
1643 {
1645 int sub_npoints = lround(npoints * sub_area / area);
1646 if (sub_npoints > 0)
1647 {
1649 if (!mpt)
1650 mpt = sub_mpt;
1651 else
1652 {
1653 uint32_t j;
1654 for (j = 0; j < sub_mpt->
ngeoms; j++)
1656
1657
1660 }
1661 }
1662 }
1663 return mpt;
1664}
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 void lwerror(const char *fmt,...) __attribute__((format(printf
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().