461{
472
473 POSTGIS_DEBUG(2, "LWGEOM_interiorringn_polygon called.");
474
475 wanted_index = PG_GETARG_INT32(1);
476 if ( wanted_index < 1 )
477 {
478 PG_RETURN_NULL();
479 }
480
481 geom = PG_GETARG_GSERIALIZED_P(0);
483
485 {
486 PG_FREE_IF_COPY(geom, 0);
487 PG_RETURN_NULL();
488 }
489
492 {
494 PG_FREE_IF_COPY(geom, 0);
495 PG_RETURN_NULL();
496 }
497
499 {
501
502
504 {
506 PG_FREE_IF_COPY(geom, 0);
507 PG_RETURN_NULL();
508 }
509
510 ring = poly->
rings[wanted_index];
511
512
514 {
517 }
518
519
521
522
526 }
527 else
528 {
530
532 {
533 PG_FREE_IF_COPY(geom, 0);
535 PG_RETURN_NULL();
536 }
537
540 }
541
542 PG_FREE_IF_COPY(geom, 0);
543 PG_RETURN_POINTER(result);
544}
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)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)