PostGIS  2.4.9dev-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  int 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:86
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
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:509
POINTARRAY ** rings
Definition: liblwgeom.h:457
int nrings
Definition: liblwgeom.h:455
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
static void analyze_geometry(struct geobuf_agg_context *ctx, LWGEOM *lwgeom)
Definition: geobuf.c:463
uint8_t type
Definition: liblwgeom.h:396
type
Definition: ovdump.py:41
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: