PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ asgml2_poly_buf()

static size_t asgml2_poly_buf ( const LWPOLY poly,
const char *  srs,
char *  output,
int  precision,
const char *  prefix 
)
static

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

371 {
372  int i;
373  char *ptr=output;
374 
375  ptr += sprintf(ptr, "<%sPolygon", prefix);
376  if ( srs ) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
377  if ( lwpoly_is_empty(poly) )
378  {
379  ptr += sprintf(ptr, "/>");
380  return (ptr-output);
381  }
382  ptr += sprintf(ptr, ">");
383  ptr += sprintf(ptr, "<%souterBoundaryIs><%sLinearRing><%scoordinates>",
384  prefix, prefix, prefix);
385  ptr += pointArray_toGML2(poly->rings[0], ptr, precision);
386  ptr += sprintf(ptr, "</%scoordinates></%sLinearRing></%souterBoundaryIs>", prefix, prefix, prefix);
387  for (i=1; i<poly->nrings; i++)
388  {
389  ptr += sprintf(ptr, "<%sinnerBoundaryIs><%sLinearRing><%scoordinates>", prefix, prefix, prefix);
390  ptr += pointArray_toGML2(poly->rings[i], ptr, precision);
391  ptr += sprintf(ptr, "</%scoordinates></%sLinearRing></%sinnerBoundaryIs>", prefix, prefix, prefix);
392  }
393  ptr += sprintf(ptr, "</%sPolygon>", prefix);
394 
395  return (ptr-output);
396 }
POINTARRAY ** rings
Definition: liblwgeom.h:441
uint8_t precision
Definition: cu_in_twkb.c:25
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:332
int nrings
Definition: liblwgeom.h:439
static size_t pointArray_toGML2(POINTARRAY *pa, char *buf, int precision)
Definition: lwout_gml.c:649
Here is the call graph for this function:
Here is the caller graph for this function: