PostGIS  2.5.7dev-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.

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 }
static void analyze_pa(struct geobuf_agg_context *ctx, POINTARRAY *pa)
Definition: geobuf.c:448
static void analyze_geometry(struct geobuf_agg_context *ctx, LWGEOM *lwgeom)
Definition: geobuf.c:463
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
type
Definition: ovdump.py:41
uint32_t ngeoms
Definition: liblwgeom.h:510
LWGEOM ** geoms
Definition: liblwgeom.h:512
uint8_t type
Definition: liblwgeom.h:399
POINTARRAY * points
Definition: liblwgeom.h:425
POINTARRAY ** rings
Definition: liblwgeom.h:460
uint32_t nrings
Definition: liblwgeom.h:458
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by geobuf_agg_transfn().

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