PostGIS  3.3.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 406 of file lwout_gml.c.

408 {
409  uint32_t i;
410  char *ptr=output;
411 
412  ptr += sprintf(ptr, "<%sPolygon", prefix);
413  if ( srs ) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
414  if ( lwpoly_is_empty(poly) )
415  {
416  ptr += sprintf(ptr, "/>");
417  return (ptr-output);
418  }
419  ptr += sprintf(ptr, ">");
420  ptr += sprintf(ptr, "<%souterBoundaryIs><%sLinearRing><%scoordinates>",
421  prefix, prefix, prefix);
422  ptr += pointArray_toGML2(poly->rings[0], ptr, precision);
423  ptr += sprintf(ptr, "</%scoordinates></%sLinearRing></%souterBoundaryIs>", prefix, prefix, prefix);
424  for (i=1; i<poly->nrings; i++)
425  {
426  ptr += sprintf(ptr, "<%sinnerBoundaryIs><%sLinearRing><%scoordinates>", prefix, prefix, prefix);
427  ptr += pointArray_toGML2(poly->rings[i], ptr, precision);
428  ptr += sprintf(ptr, "</%scoordinates></%sLinearRing></%sinnerBoundaryIs>", prefix, prefix, prefix);
429  }
430  ptr += sprintf(ptr, "</%sPolygon>", prefix);
431 
432  return (ptr-output);
433 }
static uint8_t precision
Definition: cu_in_twkb.c:25
int lwpoly_is_empty(const LWPOLY *poly)
static size_t pointArray_toGML2(POINTARRAY *pa, char *buf, int precision)
Definition: lwout_gml.c:678
POINTARRAY ** rings
Definition: liblwgeom.h:534
uint32_t nrings
Definition: liblwgeom.h:539

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

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

Here is the call graph for this function:
Here is the caller graph for this function: