PostGIS  2.4.9dev-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 382 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().

384 {
385  int i;
386  char *ptr=output;
387 
388  ptr += sprintf(ptr, "<%sPolygon", prefix);
389  if ( srs ) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
390  if ( lwpoly_is_empty(poly) )
391  {
392  ptr += sprintf(ptr, "/>");
393  return (ptr-output);
394  }
395  ptr += sprintf(ptr, ">");
396  ptr += sprintf(ptr, "<%souterBoundaryIs><%sLinearRing><%scoordinates>",
397  prefix, prefix, prefix);
398  ptr += pointArray_toGML2(poly->rings[0], ptr, precision);
399  ptr += sprintf(ptr, "</%scoordinates></%sLinearRing></%souterBoundaryIs>", prefix, prefix, prefix);
400  for (i=1; i<poly->nrings; i++)
401  {
402  ptr += sprintf(ptr, "<%sinnerBoundaryIs><%sLinearRing><%scoordinates>", prefix, prefix, prefix);
403  ptr += pointArray_toGML2(poly->rings[i], ptr, precision);
404  ptr += sprintf(ptr, "</%scoordinates></%sLinearRing></%sinnerBoundaryIs>", prefix, prefix, prefix);
405  }
406  ptr += sprintf(ptr, "</%sPolygon>", prefix);
407 
408  return (ptr-output);
409 }
POINTARRAY ** rings
Definition: liblwgeom.h:457
uint8_t precision
Definition: cu_in_twkb.c:25
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:445
int nrings
Definition: liblwgeom.h:455
static size_t pointArray_toGML2(POINTARRAY *pa, char *buf, int precision)
Definition: lwout_gml.c:662
Here is the call graph for this function:
Here is the caller graph for this function: