PostGIS  2.5.0dev-r@@SVN_REVISION@@
static Data__Geometry * encode_geometry ( struct geobuf_agg_context ctx,
LWGEOM lwgeom 
)
static

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

Referenced by encode_collection(), and geobuf_agg_finalfn().

415 {
416  int type = lwgeom->type;
417  switch (type)
418  {
419  case POINTTYPE:
420  return encode_point(ctx, (LWPOINT*)lwgeom);
421  case LINETYPE:
422  return encode_line(ctx, (LWLINE*)lwgeom);
423  case POLYGONTYPE:
424  return encode_poly(ctx, (LWPOLY*)lwgeom);
425  case MULTIPOINTTYPE:
426  return encode_mpoint(ctx, (LWMPOINT*)lwgeom);
427  case MULTILINETYPE:
428  return encode_mline(ctx, (LWMLINE*)lwgeom);
429  case MULTIPOLYGONTYPE:
430  return encode_mpoly(ctx, (LWMPOLY*)lwgeom);
431  case COLLECTIONTYPE:
432  return encode_collection(ctx, (LWCOLLECTION*)lwgeom);
433  default:
434  elog(ERROR, "encode_geometry: '%s' geometry type not supported",
435  lwtype_name(type));
436  }
437  return NULL;
438 }
#define LINETYPE
Definition: liblwgeom.h:85
static Data__Geometry * encode_mline(struct geobuf_agg_context *ctx, LWMLINE *lwmline)
Definition: geobuf.c:261
static Data__Geometry * encode_collection(struct geobuf_agg_context *ctx, LWCOLLECTION *lwcollection)
Definition: geobuf.c:387
#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:298
static Data__Geometry * encode_mpoly(struct geobuf_agg_context *ctx, LWMPOLY *lwmpoly)
Definition: geobuf.c:336
static Data__Geometry * encode_point(struct geobuf_agg_context *ctx, LWPOINT *lwpoint)
Definition: geobuf.c:193
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:214
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
#define MULTILINETYPE
Definition: liblwgeom.h:88
static Data__Geometry * encode_line(struct geobuf_agg_context *ctx, LWLINE *lwline)
Definition: geobuf.c:242
#define COLLECTIONTYPE
Definition: liblwgeom.h:90

Here is the call graph for this function:

Here is the caller graph for this function: