PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asgeojson_geom_buf ( const LWGEOM geom,
char *  output,
GBOX bbox,
int  precision 
)
static

Definition at line 627 of file lwout_geojson.c.

References asgeojson_line_buf(), asgeojson_multiline_buf(), asgeojson_multipoint_buf(), asgeojson_multipolygon_buf(), asgeojson_point_buf(), asgeojson_poly_buf(), LINETYPE, lwerror(), lwfree(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, and LWGEOM::type.

Referenced by asgeojson_collection_buf().

628 {
629  int type = geom->type;
630  char *ptr=output;
631 
632  switch (type)
633  {
634  case POINTTYPE:
635  ptr += asgeojson_point_buf((LWPOINT*)geom, NULL, ptr, bbox, precision);
636  break;
637 
638  case LINETYPE:
639  ptr += asgeojson_line_buf((LWLINE*)geom, NULL, ptr, bbox, precision);
640  break;
641 
642  case POLYGONTYPE:
643  ptr += asgeojson_poly_buf((LWPOLY*)geom, NULL, ptr, bbox, precision);
644  break;
645 
646  case MULTIPOINTTYPE:
647  ptr += asgeojson_multipoint_buf((LWMPOINT*)geom, NULL, ptr, bbox, precision);
648  break;
649 
650  case MULTILINETYPE:
651  ptr += asgeojson_multiline_buf((LWMLINE*)geom, NULL, ptr, bbox, precision);
652  break;
653 
654  case MULTIPOLYGONTYPE:
655  ptr += asgeojson_multipolygon_buf((LWMPOLY*)geom, NULL, ptr, bbox, precision);
656  break;
657 
658  default:
659  if (bbox) lwfree(bbox);
660  lwerror("GeoJson: geometry not supported.");
661  }
662 
663  return (ptr-output);
664 }
static size_t asgeojson_point_buf(const LWPOINT *point, char *srs, char *output, GBOX *bbox, int precision)
#define LINETYPE
Definition: liblwgeom.h:61
static size_t asgeojson_multiline_buf(const LWMLINE *mline, char *srs, char *output, GBOX *bbox, int precision)
void lwfree(void *mem)
Definition: lwutil.c:190
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
static size_t asgeojson_poly_buf(const LWPOLY *poly, char *srs, char *output, GBOX *bbox, int precision)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
static size_t asgeojson_multipoint_buf(const LWMPOINT *mpoint, char *srs, char *output, GBOX *bbox, int precision)
static size_t asgeojson_line_buf(const LWLINE *line, char *srs, char *output, GBOX *bbox, int precision)
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
static size_t asgeojson_multipolygon_buf(const LWMPOLY *mpoly, char *srs, char *output, GBOX *bbox, int precision)
uint8_t type
Definition: liblwgeom.h:352
#define MULTILINETYPE
Definition: liblwgeom.h:64

Here is the call graph for this function:

Here is the caller graph for this function: