PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asgml2_poly_buf ( const LWPOLY poly,
const char *  srs,
char *  output,
int  precision,
const char *  prefix 
)
static

Definition at line 360 of file lwout_gml.c.

References lwpoly_is_empty(), LWPOLY::nrings, pointArray_toGML2(), and LWPOLY::rings.

Referenced by asgml2_collection_buf(), asgml2_multi_buf(), and asgml2_poly().

362 {
363  int i;
364  char *ptr=output;
365 
366  ptr += sprintf(ptr, "<%sPolygon", prefix);
367  if ( srs ) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
368  if ( lwpoly_is_empty(poly) ) {
369  ptr += sprintf(ptr, "/>");
370  return (ptr-output);
371  }
372  ptr += sprintf(ptr, ">");
373  ptr += sprintf(ptr, "<%souterBoundaryIs><%sLinearRing><%scoordinates>",
374  prefix, prefix, prefix);
375  ptr += pointArray_toGML2(poly->rings[0], ptr, precision);
376  ptr += sprintf(ptr, "</%scoordinates></%sLinearRing></%souterBoundaryIs>", prefix, prefix, prefix);
377  for (i=1; i<poly->nrings; i++)
378  {
379  ptr += sprintf(ptr, "<%sinnerBoundaryIs><%sLinearRing><%scoordinates>", prefix, prefix, prefix);
380  ptr += pointArray_toGML2(poly->rings[i], ptr, precision);
381  ptr += sprintf(ptr, "</%scoordinates></%sLinearRing></%sinnerBoundaryIs>", prefix, prefix, prefix);
382  }
383  ptr += sprintf(ptr, "</%sPolygon>", prefix);
384 
385  return (ptr-output);
386 }
POINTARRAY ** rings
Definition: liblwgeom.h:413
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:327
int nrings
Definition: liblwgeom.h:411
static size_t pointArray_toGML2(POINTARRAY *pa, char *buf, int precision)
Definition: lwout_gml.c:637

Here is the call graph for this function:

Here is the caller graph for this function: