PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ lwgeom_summary()

char* lwgeom_summary ( const LWGEOM lwgeom,
int  offset 
)

Definition at line 158 of file lwgeom_debug.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LINETYPE, lwalloc(), lwcollection_summary(), lwline_summary(), lwpoint_summary(), lwpoly_summary(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, TINTYPE, TRIANGLETYPE, LWGEOM::type, and LWCOLLECTION::type.

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

159 {
160  char *result;
161 
162  switch (lwgeom->type)
163  {
164  case POINTTYPE:
165  return lwpoint_summary((LWPOINT *)lwgeom, offset);
166 
167  case CIRCSTRINGTYPE:
168  case TRIANGLETYPE:
169  case LINETYPE:
170  return lwline_summary((LWLINE *)lwgeom, offset);
171 
172  case POLYGONTYPE:
173  return lwpoly_summary((LWPOLY *)lwgeom, offset);
174 
175  case TINTYPE:
176  case MULTISURFACETYPE:
177  case MULTICURVETYPE:
178  case CURVEPOLYTYPE:
179  case COMPOUNDTYPE:
180  case MULTIPOINTTYPE:
181  case MULTILINETYPE:
182  case MULTIPOLYGONTYPE:
183  case COLLECTIONTYPE:
184  return lwcollection_summary((LWCOLLECTION *)lwgeom, offset);
185  default:
186  result = (char *)lwalloc(256);
187  sprintf(result, "Object is of unknown type: %d",
188  lwgeom->type);
189  return result;
190  }
191 
192  return NULL;
193 }
#define LINETYPE
Definition: liblwgeom.h:85
static char * lwline_summary(LWLINE *line, int offset)
Definition: lwgeom_debug.c:70
#define MULTICURVETYPE
Definition: liblwgeom.h:94
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define CURVEPOLYTYPE
Definition: liblwgeom.h:93
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
#define TRIANGLETYPE
Definition: liblwgeom.h:97
static char * lwpoint_summary(LWPOINT *point, int offset)
Definition: lwgeom_debug.c:55
#define TINTYPE
Definition: liblwgeom.h:98
static char * lwpoly_summary(LWPOLY *poly, int offset)
Definition: lwgeom_debug.c:125
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define MULTISURFACETYPE
Definition: liblwgeom.h:95
static char * lwcollection_summary(LWCOLLECTION *col, int offset)
Definition: lwgeom_debug.c:87
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:398
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
void * lwalloc(size_t size)
Definition: lwutil.c:229
#define MULTILINETYPE
Definition: liblwgeom.h:88
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
Here is the call graph for this function:
Here is the caller graph for this function: