1530{
1532 ArrayType *array = NULL;
1534 const LWLINE *shell = NULL;
1535 const LWLINE **holes = NULL;
1537 uint32 nholes = 0;
1538 uint32 i;
1539 size_t offset = 0;
1540
1541 POSTGIS_DEBUG(2, "LWGEOM_makepoly called.");
1542
1543
1544 pglwg1 = PG_GETARG_GSERIALIZED_P(0);
1546 {
1547 lwpgerror("Shell is not a line");
1548 }
1550
1551
1552 if (PG_NARGS() > 1)
1553 {
1554 array = PG_GETARG_ARRAYTYPE_P(1);
1555 nholes = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array));
1557 for (i = 0; i < nholes; i++)
1558 {
1559#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
1560#pragma GCC diagnostic push
1561#pragma GCC diagnostic ignored "-Wsign-compare"
1562#endif
1564#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
1565#pragma GCC diagnostic pop
1566#endif
1568 offset += INTALIGN(VARSIZE(g));
1570 {
1571 lwpgerror("Hole %d is not a line", i);
1572 }
1574 holes[i] = hole;
1575 }
1576 }
1577
1581
1583 PG_FREE_IF_COPY(pglwg1, 0);
1584
1585 for (i = 0; i < nholes; i++)
1586 {
1588 }
1589
1590 PG_RETURN_POINTER(result);
1591}
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)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)