PostGIS  2.1.10dev-r@@SVN_REVISION@@
char* lwgeom_summary ( const LWGEOM lwgeom,
int  offset 
)

Definition at line 145 of file lwgeom_debug.c.

References COLLECTIONTYPE, LINETYPE, lwalloc(), lwcollection_summary(), lwline_summary(), lwpoint_summary(), lwpoly_summary(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, result, and LWGEOM::type.

Referenced by GEOS2POSTGIS(), lwcollection_summary(), LWGEOM_makepoly(), LWGEOM_noop(), and LWGEOM_summary().

146 {
147  char *result;
148 
149  switch (lwgeom->type)
150  {
151  case POINTTYPE:
152  return lwpoint_summary((LWPOINT *)lwgeom, offset);
153 
154  case LINETYPE:
155  return lwline_summary((LWLINE *)lwgeom, offset);
156 
157  case POLYGONTYPE:
158  return lwpoly_summary((LWPOLY *)lwgeom, offset);
159 
160  case MULTIPOINTTYPE:
161  case MULTILINETYPE:
162  case MULTIPOLYGONTYPE:
163  case COLLECTIONTYPE:
164  return lwcollection_summary((LWCOLLECTION *)lwgeom, offset);
165  default:
166  result = (char *)lwalloc(256);
167  sprintf(result, "Object is of unknown type: %d",
168  lwgeom->type);
169  return result;
170  }
171 
172  return NULL;
173 }
#define LINETYPE
Definition: liblwgeom.h:61
static char * lwline_summary(LWLINE *line, int offset)
Definition: lwgeom_debug.c:57
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
static char * lwpoint_summary(LWPOINT *point, int offset)
Definition: lwgeom_debug.c:42
char ** result
Definition: liblwgeom.h:218
static char * lwpoly_summary(LWPOLY *poly, int offset)
Definition: lwgeom_debug.c:112
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
static char * lwcollection_summary(LWCOLLECTION *col, int offset)
Definition: lwgeom_debug.c:74
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
uint8_t type
Definition: liblwgeom.h:352
void * lwalloc(size_t size)
Definition: lwutil.c:175
#define MULTILINETYPE
Definition: liblwgeom.h:64
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: