PostGIS  2.1.10dev-r@@SVN_REVISION@@
static int lwcollection_to_kml2_sb ( const LWCOLLECTION col,
int  precision,
const char *  prefix,
stringbuffer_t sb 
)
static

Definition at line 171 of file lwout_kml.c.

References LWCOLLECTION::geoms, LW_FAILURE, LW_SUCCESS, lwgeom_to_kml2_sb(), LWCOLLECTION::ngeoms, and stringbuffer_aprintf().

Referenced by lwgeom_to_kml2_sb().

172 {
173  int i, rv;
174 
175  /* Open geometry */
176  if ( stringbuffer_aprintf(sb, "<%sMultiGeometry>", prefix) < 0 ) return LW_FAILURE;
177  for ( i = 0; i < col->ngeoms; i++ )
178  {
179  rv = lwgeom_to_kml2_sb(col->geoms[i], precision, prefix, sb);
180  if ( rv == LW_FAILURE ) return LW_FAILURE;
181  }
182  /* Close geometry */
183  if ( stringbuffer_aprintf(sb, "</%sMultiGeometry>", prefix) < 0 ) return LW_FAILURE;
184 
185  return LW_SUCCESS;
186 }
#define LW_SUCCESS
Definition: liblwgeom.h:55
#define LW_FAILURE
Definition: liblwgeom.h:54
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided...
Definition: stringbuffer.c:247
LWGEOM ** geoms
Definition: liblwgeom.h:465
static int lwgeom_to_kml2_sb(const LWGEOM *geom, int precision, const char *prefix, stringbuffer_t *sb)
Definition: lwout_kml.c:58

Here is the call graph for this function:

Here is the caller graph for this function: