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

◆ asgml3_poly()

static void asgml3_poly ( stringbuffer_t sb,
const LWPOLY poly,
const GML_Options opts 
)
static

Definition at line 456 of file lwout_gml.c.

457{
458 uint32_t i;
459 int dimension = FLAGS_GET_Z(poly->flags) ? 3 : 2;
460
462 opts->is_patch ? "<%sPolygonPatch" : "<%sPolygon",
463 opts->prefix);
464
465 if (opts->srs) stringbuffer_aprintf(sb, " srsName=\"%s\"", opts->srs);
466 if (opts->id) stringbuffer_aprintf(sb, " %sid=\"%s\"", opts->prefix, opts->id);
467
468 if (lwpoly_is_empty(poly))
469 {
470 stringbuffer_append(sb, "/>");
471 return;
472 }
473 stringbuffer_append(sb, ">");
474
475 stringbuffer_aprintf(sb, "<%sexterior>", opts->prefix);
476 stringbuffer_aprintf(sb, "<%sLinearRing>", opts->prefix);
477 if (IS_DIMS(opts->opts))
478 stringbuffer_aprintf(sb, "<%sposList srsDimension=\"%d\">", opts->prefix, dimension);
479 else
480 stringbuffer_aprintf(sb, "<%sposList>", opts->prefix);
481
482 asgml3_ptarray(sb, poly->rings[0], opts);
483 stringbuffer_aprintf(sb, "</%sposList>", opts->prefix);
484 stringbuffer_aprintf(sb, "</%sLinearRing>", opts->prefix);
485 stringbuffer_aprintf(sb, "</%sexterior>", opts->prefix);
486 for (i=1; i<poly->nrings; i++)
487 {
488 stringbuffer_aprintf(sb, "<%sinterior>", opts->prefix);
489 stringbuffer_aprintf(sb, "<%sLinearRing>", opts->prefix);
490 if (IS_DIMS(opts->opts))
491 stringbuffer_aprintf(sb, "<%sposList srsDimension=\"%d\">", opts->prefix, dimension);
492 else
493 stringbuffer_aprintf(sb, "<%sposList>", opts->prefix);
494 asgml3_ptarray(sb, poly->rings[i], opts);
495 stringbuffer_aprintf(sb, "</%sposList>", opts->prefix);
496 stringbuffer_aprintf(sb, "</%sLinearRing>", opts->prefix);
497 stringbuffer_aprintf(sb, "</%sinterior>", opts->prefix);
498 }
499
501 opts->is_patch ? "</%sPolygonPatch>" : "</%sPolygon>",
502 opts->prefix);
503}
#define IS_DIMS(x)
Definition liblwgeom.h:1721
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:165
int lwpoly_is_empty(const LWPOLY *poly)
static void asgml3_ptarray(stringbuffer_t *sb, const POINTARRAY *pa, const GML_Options *opts)
Definition lwout_gml.c:112
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.
static void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
POINTARRAY ** rings
Definition liblwgeom.h:519
uint32_t nrings
Definition liblwgeom.h:524
lwflags_t flags
Definition liblwgeom.h:521

References asgml3_ptarray(), LWPOLY::flags, FLAGS_GET_Z, IS_DIMS, lwpoly_is_empty(), LWPOLY::nrings, LWPOLY::rings, stringbuffer_append(), and stringbuffer_aprintf().

Referenced by asgml3_collection(), asgml3_multi(), asgml3_multisurface(), asgml3_psurface(), and lwgeom_to_gml3().

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