PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ lwgeom_to_points()

LWMPOINT* lwgeom_to_points ( const LWGEOM lwgeom,
uint32_t  npoints 

Definition at line 1629 of file liblwgeom/lwgeom_geos.c.

References lwerror(), lwgeom_get_type(), lwmpoly_to_points(), lwpoly_to_points(), lwtype_name(), MULTIPOLYGONTYPE, and POLYGONTYPE.

Referenced by ST_GeneratePoints(), and test_point_density().

1630 {
1631  switch (lwgeom_get_type(lwgeom))
1632  {
1634  return lwmpoly_to_points((LWMPOLY*)lwgeom, npoints);
1635  case POLYGONTYPE:
1636  return lwpoly_to_points((LWPOLY*)lwgeom, npoints);
1637  default:
1638  lwerror("%s: unsupported geometry type '%s'", __func__, lwtype_name(lwgeom_get_type(lwgeom)));
1639  return NULL;
1640  }
1641 }
uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
Definition: lwgeom.c:923
Definition: liblwgeom.h:86
LWMPOINT * lwpoly_to_points(const LWPOLY *lwpoly, uint32_t npoints)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
Definition: liblwgeom.h:89
LWMPOINT * lwmpoly_to_points(const LWMPOLY *lwmpoly, uint32_t npoints)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
Here is the call graph for this function:
Here is the caller graph for this function: