PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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.

384{
385 uint32_t 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}
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:662
POINTARRAY ** rings
Definition liblwgeom.h:505
uint32_t nrings
Definition liblwgeom.h:510

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: