PostGIS  2.5.0dev-r@@SVN_REVISION@@
static void analyze_geometry ( struct geobuf_agg_context ctx,
LWGEOM lwgeom 
)
static

Definition at line 462 of file geobuf.c.

References analyze_pa(), COLLECTIONTYPE, LWCOLLECTION::geoms, LINETYPE, lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, LWPOLY::nrings, LWLINE::points, POINTTYPE, POLYGONTYPE, LWPOLY::rings, geomtype_struct::type, and LWGEOM::type.

Referenced by geobuf_agg_transfn().

463 {
464  uint32_t i, type;
465  LWLINE *lwline;
466  LWPOLY *lwpoly;
467  LWCOLLECTION *lwcollection;
468  type = lwgeom->type;
469  switch (type)
470  {
471  case POINTTYPE:
472  case LINETYPE:
473  lwline = (LWLINE*) lwgeom;
474  analyze_pa(ctx, lwline->points);
475  break;
476  case POLYGONTYPE:
477  lwpoly = (LWPOLY*) lwgeom;
478  for (i = 0; i < lwpoly->nrings; i++)
479  analyze_pa(ctx, lwpoly->rings[i]);
480  break;
481  case MULTIPOINTTYPE:
482  case MULTILINETYPE:
483  case MULTIPOLYGONTYPE:
484  case COLLECTIONTYPE:
485  lwcollection = (LWCOLLECTION*) lwgeom;
486  for (i = 0; i < lwcollection->ngeoms; i++)
487  analyze_geometry(ctx, lwcollection->geoms[i]);
488  break;
489  default:
490  elog(ERROR, "analyze_geometry: '%s' geometry type not supported",
491  lwtype_name(type));
492  }
493 }
#define LINETYPE
Definition: liblwgeom.h:85
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
uint32_t ngeoms
Definition: liblwgeom.h:506
uint32_t nrings
Definition: liblwgeom.h:454
unsigned int uint32_t
Definition: uthash.h:78
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
static void analyze_pa(struct geobuf_agg_context *ctx, POINTARRAY *pa)
Definition: geobuf.c:447
LWGEOM ** geoms
Definition: liblwgeom.h:508
POINTARRAY ** rings
Definition: liblwgeom.h:456
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
static void analyze_geometry(struct geobuf_agg_context *ctx, LWGEOM *lwgeom)
Definition: geobuf.c:462
uint8_t type
Definition: liblwgeom.h:395
#define MULTILINETYPE
Definition: liblwgeom.h:88
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
POINTARRAY * points
Definition: liblwgeom.h:421

Here is the call graph for this function:

Here is the caller graph for this function: