PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ analyze_geometry()

static void analyze_geometry ( struct geobuf_agg_context ctx,
LWGEOM lwgeom 
)
static

Definition at line 463 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, ovdump::type, and LWGEOM::type.

Referenced by geobuf_agg_transfn().

464 {
465  uint32_t i, type;
466  LWLINE *lwline;
467  LWPOLY *lwpoly;
468  LWCOLLECTION *lwcollection;
469  type = lwgeom->type;
470  switch (type)
471  {
472  case POINTTYPE:
473  case LINETYPE:
474  lwline = (LWLINE*) lwgeom;
475  analyze_pa(ctx, lwline->points);
476  break;
477  case POLYGONTYPE:
478  lwpoly = (LWPOLY*) lwgeom;
479  for (i = 0; i < lwpoly->nrings; i++)
480  analyze_pa(ctx, lwpoly->rings[i]);
481  break;
482  case MULTIPOINTTYPE:
483  case MULTILINETYPE:
484  case MULTIPOLYGONTYPE:
485  case COLLECTIONTYPE:
486  lwcollection = (LWCOLLECTION*) lwgeom;
487  for (i = 0; i < lwcollection->ngeoms; i++)
488  analyze_geometry(ctx, lwcollection->geoms[i]);
489  break;
490  default:
491  elog(ERROR, "analyze_geometry: '%s' geometry type not supported",
492  lwtype_name(type));
493  }
494 }
#define LINETYPE
Definition: liblwgeom.h:85
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
uint32_t ngeoms
Definition: liblwgeom.h:509
uint32_t nrings
Definition: liblwgeom.h:457
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:448
LWGEOM ** geoms
Definition: liblwgeom.h:511
POINTARRAY ** rings
Definition: liblwgeom.h:459
#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:463
uint8_t type
Definition: liblwgeom.h:398
type
Definition: ovdump.py:41
#define MULTILINETYPE
Definition: liblwgeom.h:88
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
POINTARRAY * points
Definition: liblwgeom.h:424
Here is the call graph for this function:
Here is the caller graph for this function: