PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ encode_geometry()

static Data__Geometry * encode_geometry ( struct geobuf_agg_context ctx,
LWGEOM lwgeom 
)
static

Definition at line 414 of file geobuf.c.

References COLLECTIONTYPE, encode_collection(), encode_line(), encode_mline(), encode_mpoint(), encode_mpoly(), encode_point(), encode_poly(), LINETYPE, lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, ovdump::type, and LWGEOM::type.

Referenced by encode_collection(), and geobuf_agg_finalfn().

416 {
417  int type = lwgeom->type;
418  switch (type)
419  {
420  case POINTTYPE:
421  return encode_point(ctx, (LWPOINT*)lwgeom);
422  case LINETYPE:
423  return encode_line(ctx, (LWLINE*)lwgeom);
424  case POLYGONTYPE:
425  return encode_poly(ctx, (LWPOLY*)lwgeom);
426  case MULTIPOINTTYPE:
427  return encode_mpoint(ctx, (LWMPOINT*)lwgeom);
428  case MULTILINETYPE:
429  return encode_mline(ctx, (LWMLINE*)lwgeom);
430  case MULTIPOLYGONTYPE:
431  return encode_mpoly(ctx, (LWMPOLY*)lwgeom);
432  case COLLECTIONTYPE:
433  return encode_collection(ctx, (LWCOLLECTION*)lwgeom);
434  default:
435  elog(ERROR, "encode_geometry: '%s' geometry type not supported",
436  lwtype_name(type));
437  }
438  return NULL;
439 }
#define LINETYPE
Definition: liblwgeom.h:85
static Data__Geometry * encode_mline(struct geobuf_agg_context *ctx, LWMLINE *lwmline)
Definition: geobuf.c:262
static Data__Geometry * encode_collection(struct geobuf_agg_context *ctx, LWCOLLECTION *lwcollection)
Definition: geobuf.c:388
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
static Data__Geometry * encode_poly(struct geobuf_agg_context *ctx, LWPOLY *lwpoly)
Definition: geobuf.c:299
static Data__Geometry * encode_mpoly(struct geobuf_agg_context *ctx, LWMPOLY *lwmpoly)
Definition: geobuf.c:337
static Data__Geometry * encode_point(struct geobuf_agg_context *ctx, LWPOINT *lwpoint)
Definition: geobuf.c:194
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
static Data__Geometry * encode_mpoint(struct geobuf_agg_context *ctx, LWMPOINT *lwmpoint)
Definition: geobuf.c:215
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:398
type
Definition: ovdump.py:41
#define MULTILINETYPE
Definition: liblwgeom.h:88
static Data__Geometry * encode_line(struct geobuf_agg_context *ctx, LWLINE *lwline)
Definition: geobuf.c:243
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
Here is the call graph for this function:
Here is the caller graph for this function: