PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ lwcollection_to_kml2_sb()

static int lwcollection_to_kml2_sb ( const LWCOLLECTION col,
int  precision,
const char *  prefix,
stringbuffer_t sb 
)
static

Definition at line 183 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().

184 {
185  uint32_t i;
186  int rv;
187 
188  /* Open geometry */
189  if ( stringbuffer_aprintf(sb, "<%sMultiGeometry>", prefix) < 0 ) return LW_FAILURE;
190  for ( i = 0; i < col->ngeoms; i++ )
191  {
192  rv = lwgeom_to_kml2_sb(col->geoms[i], precision, prefix, sb);
193  if ( rv == LW_FAILURE ) return LW_FAILURE;
194  }
195  /* Close geometry */
196  if ( stringbuffer_aprintf(sb, "</%sMultiGeometry>", prefix) < 0 ) return LW_FAILURE;
197 
198  return LW_SUCCESS;
199 }
#define LW_SUCCESS
Definition: liblwgeom.h:79
uint32_t ngeoms
Definition: liblwgeom.h:509
#define LW_FAILURE
Definition: liblwgeom.h:78
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:253
unsigned int uint32_t
Definition: uthash.h:78
LWGEOM ** geoms
Definition: liblwgeom.h:511
uint8_t precision
Definition: cu_in_twkb.c:25
static int lwgeom_to_kml2_sb(const LWGEOM *geom, int precision, const char *prefix, stringbuffer_t *sb)
Definition: lwout_kml.c:69
Here is the call graph for this function:
Here is the caller graph for this function: