600{
611
612 POSTGIS_DEBUG(2, "LWGEOM_interiorringn_polygon called.");
613
614 wanted_index = PG_GETARG_INT32(1);
615 if ( wanted_index < 1 )
616 {
617 PG_RETURN_NULL();
618 }
619
620 geom = PG_GETARG_GSERIALIZED_P(0);
622
624 {
625 PG_FREE_IF_COPY(geom, 0);
626 PG_RETURN_NULL();
627 }
628
631 {
633 PG_FREE_IF_COPY(geom, 0);
634 PG_RETURN_NULL();
635 }
636
638 {
640
641
643 {
645 PG_FREE_IF_COPY(geom, 0);
646 PG_RETURN_NULL();
647 }
648
649 ring = poly->
rings[wanted_index];
650
651
653 {
656 }
657
658
660
661
665 }
666 else
667 {
669
671 {
672 PG_FREE_IF_COPY(geom, 0);
674 PG_RETURN_NULL();
675 }
676
677 result = geometry_serialize(curvepoly->
rings[wanted_index]);
679 }
680
681 PG_FREE_IF_COPY(geom, 0);
682 PG_RETURN_POINTER(
result);
683}
char result[OUT_DOUBLE_BUFFER_SIZE]
int ptarray_calculate_gbox_cartesian(const POINTARRAY *pa, GBOX *gbox)
Calculate box (x/y) and add values to gbox.
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,...
void lwgeom_free(LWGEOM *geom)
void lwline_release(LWLINE *lwline)
LWCURVEPOLY * lwgeom_as_lwcurvepoly(const LWGEOM *lwgeom)
void * lwalloc(size_t size)
LWPOLY * lwgeom_as_lwpoly(const LWGEOM *lwgeom)
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
void lwpoly_free(LWPOLY *poly)
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)