PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_to_kml2_sb()

static int lwgeom_to_kml2_sb ( const LWGEOM geom,
int  precision,
const char *  prefix,
stringbuffer_t sb 
)
static

Definition at line 69 of file lwout_kml.c.

References LINETYPE, LW_FAILURE, lwcollection_to_kml2_sb(), lwerror(), lwline_to_kml2_sb(), lwpoint_to_kml2_sb(), lwpoly_to_kml2_sb(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, LWGEOM::type, and LWCOLLECTION::type.

Referenced by lwcollection_to_kml2_sb(), and lwgeom_to_kml2().

70 {
71  switch (geom->type)
72  {
73  case POINTTYPE:
74  return lwpoint_to_kml2_sb((LWPOINT*)geom, precision, prefix, sb);
75 
76  case LINETYPE:
77  return lwline_to_kml2_sb((LWLINE*)geom, precision, prefix, sb);
78 
79  case POLYGONTYPE:
80  return lwpoly_to_kml2_sb((LWPOLY*)geom, precision, prefix, sb);
81 
82  case MULTIPOINTTYPE:
83  case MULTILINETYPE:
84  case MULTIPOLYGONTYPE:
85  return lwcollection_to_kml2_sb((LWCOLLECTION*)geom, precision, prefix, sb);
86 
87  default:
88  lwerror("lwgeom_to_kml2: '%s' geometry type not supported", lwtype_name(geom->type));
89  return LW_FAILURE;
90  }
91 }
#define LINETYPE
Definition: liblwgeom.h:86
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define LW_FAILURE
Definition: liblwgeom.h:79
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
uint8_t precision
Definition: cu_in_twkb.c:25
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
static int lwcollection_to_kml2_sb(const LWCOLLECTION *col, int precision, const char *prefix, stringbuffer_t *sb)
Definition: lwout_kml.c:182
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
uint8_t type
Definition: liblwgeom.h:396
static int lwpoly_to_kml2_sb(const LWPOLY *poly, int precision, const char *prefix, stringbuffer_t *sb)
Definition: lwout_kml.c:150
static int lwline_to_kml2_sb(const LWLINE *line, int precision, const char *prefix, stringbuffer_t *sb)
Definition: lwout_kml.c:137
#define MULTILINETYPE
Definition: liblwgeom.h:89
static int lwpoint_to_kml2_sb(const LWPOINT *point, int precision, const char *prefix, stringbuffer_t *sb)
Definition: lwout_kml.c:125
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
Here is the call graph for this function:
Here is the caller graph for this function: