PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwpoly_summary()

static char* lwpoly_summary ( LWPOLY poly,
int  offset 
)
static

Definition at line 125 of file lwgeom_debug.c.

126 {
127  char tmp[256];
128  size_t size = 64*(poly->nrings+1)+128;
129  char *result;
130  uint32_t i;
131  char *pad="";
132  static char *nl = "\n";
133  char *zmflags = lwgeom_flagchars((LWGEOM*)poly);
134 
135  LWDEBUG(2, "lwpoly_summary called");
136 
137  result = (char *)lwalloc(size);
138 
139  sprintf(result, "%*.s%s[%s] with %i rings\n",
140  offset, pad, lwtype_name(poly->type),
141  zmflags,
142  poly->nrings);
143 
144  for (i=0; i<poly->nrings; i++)
145  {
146  sprintf(tmp,"%s ring %i has %i points",
147  pad, i, poly->rings[i]->npoints);
148  if ( i > 0 ) strcat(result,nl);
149  strcat(result,tmp);
150  }
151 
152  LWDEBUG(3, "lwpoly_summary returning");
153 
154  return result;
155 }
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
void * lwalloc(size_t size)
Definition: lwutil.c:229
static char * lwgeom_flagchars(LWGEOM *lwg)
Definition: lwgeom_debug.c:36
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
POINTARRAY ** rings
Definition: liblwgeom.h:460
uint8_t type
Definition: liblwgeom.h:454
uint32_t nrings
Definition: liblwgeom.h:458
uint32_t npoints
Definition: liblwgeom.h:374
unsigned int uint32_t
Definition: uthash.h:78

References lwalloc(), LWDEBUG, lwgeom_flagchars(), lwtype_name(), POINTARRAY::npoints, LWPOLY::nrings, LWPOLY::rings, and LWPOLY::type.

Referenced by lwgeom_summary().

Here is the call graph for this function:
Here is the caller graph for this function: