1559{
1561 ArrayType *array = NULL;
1563 const LWLINE *shell = NULL;
1564 const LWLINE **holes = NULL;
1566 uint32 nholes = 0;
1567 uint32 i;
1568 size_t offset = 0;
1569
1570 POSTGIS_DEBUG(2, "LWGEOM_makepoly called.");
1571
1572
1573 pglwg1 = PG_GETARG_GSERIALIZED_P(0);
1575 {
1576 lwpgerror("Shell is not a line");
1577 }
1579
1580
1581 if (PG_NARGS() > 1)
1582 {
1583 array = PG_GETARG_ARRAYTYPE_P(1);
1584 nholes = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array));
1586 for (i = 0; i < nholes; i++)
1587 {
1588#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
1589#pragma GCC diagnostic push
1590#pragma GCC diagnostic ignored "-Wsign-compare"
1591#endif
1593#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
1594#pragma GCC diagnostic pop
1595#endif
1597 offset += INTALIGN(VARSIZE(g));
1599 {
1600 lwpgerror("Hole %d is not a line", i);
1601 }
1603 holes[i] = hole;
1604 }
1605 }
1606
1610
1612 PG_FREE_IF_COPY(pglwg1, 0);
1613
1614 for (i = 0; i < nholes; i++)
1615 {
1617 }
1618
1619 PG_RETURN_POINTER(
result);
1620}
char result[OUT_DOUBLE_BUFFER_SIZE]
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
char * lwgeom_summary(const LWGEOM *lwgeom, int offset)
LWPOLY * lwpoly_from_lwlines(const LWLINE *shell, uint32_t nholes, const LWLINE **holes)
void * lwalloc(size_t size)
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
void lwline_free(LWLINE *line)