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

◆ asgml3_curvepoly()

static void asgml3_curvepoly ( stringbuffer_t sb,
const LWCURVEPOLY poly,
const GML_Options opts 
)
static

Definition at line 590 of file lwout_gml.c.

591{
592 uint32_t i;
593 LWGEOM* subgeom;
594 int dimension = FLAGS_GET_Z(poly->flags) ? 3 : 2;
595
596 /* Subgeoms don't get an SRS */
597 GML_Options subopts = *opts;
598 subopts.srs = 0;
599
600 stringbuffer_aprintf(sb, "<%sPolygon", opts->prefix);
601 if (opts->srs)
602 {
603 stringbuffer_aprintf(sb, " srsName=\"%s\"", opts->srs);
604 }
605 if (opts->id)
606 {
607 stringbuffer_aprintf(sb, " %sid=\"%s\"", opts->prefix, opts->id);
608 }
609 stringbuffer_append(sb, ">");
610
611 for (i = 0; i < poly->nrings; ++i)
612 {
614 i ? "<%sinterior>" : "<%sexterior>",
615 opts->prefix);
616
617 subgeom = poly->rings[i];
618 if (subgeom->type == LINETYPE)
619 {
620 stringbuffer_aprintf(sb, "<%sLinearRing>", opts->prefix);
621 stringbuffer_aprintf(sb, "<%sposList", opts->prefix);
622 if (IS_DIMS(opts->opts))
623 {
624 stringbuffer_aprintf(sb, " srsDimension=\"%d\"", dimension);
625 }
626 stringbuffer_append(sb, ">");
627 asgml3_ptarray(sb, ((LWLINE*)subgeom)->points, opts);
628 stringbuffer_aprintf(sb, "</%sposList>", opts->prefix);
629 stringbuffer_aprintf(sb, "</%sLinearRing>", opts->prefix);
630 }
631 else if (subgeom->type == CIRCSTRINGTYPE)
632 {
633 stringbuffer_aprintf(sb, "<%sRing>", opts->prefix);
634 stringbuffer_aprintf(sb, "<%scurveMember>", opts->prefix);
635 asgml3_circstring(sb, (LWCIRCSTRING*)subgeom, &subopts);
636 stringbuffer_aprintf(sb, "</%scurveMember>", opts->prefix);
637 stringbuffer_aprintf(sb, "</%sRing>", opts->prefix);
638 }
639 else if (subgeom->type == COMPOUNDTYPE)
640 {
641 stringbuffer_aprintf(sb, "<%sRing>", opts->prefix);
642 stringbuffer_aprintf(sb, "<%scurveMember>", opts->prefix);
643 asgml3_compound(sb, (LWCOMPOUND*)subgeom, &subopts);
644 stringbuffer_aprintf(sb, "</%scurveMember>", opts->prefix);
645 stringbuffer_aprintf(sb, "</%sRing>", opts->prefix);
646 }
647
649 i ? "</%sinterior>" : "</%sexterior>",
650 opts->prefix);
651 }
652 stringbuffer_aprintf(sb, "</%sPolygon>", opts->prefix);
653}
#define COMPOUNDTYPE
Definition liblwgeom.h:110
#define IS_DIMS(x)
Definition liblwgeom.h:1721
#define LINETYPE
Definition liblwgeom.h:103
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:165
#define CIRCSTRINGTYPE
Definition liblwgeom.h:109
static void asgml3_compound(stringbuffer_t *sb, const LWCOMPOUND *col, const GML_Options *opts)
Definition lwout_gml.c:540
static void asgml3_circstring(stringbuffer_t *sb, const LWCIRCSTRING *circ, const GML_Options *opts)
Definition lwout_gml.c:507
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.
const char * srs
Definition lwout_gml.c:41
LWGEOM ** rings
Definition liblwgeom.h:603
lwflags_t flags
Definition liblwgeom.h:605
uint32_t nrings
Definition liblwgeom.h:608
uint8_t type
Definition liblwgeom.h:462

References asgml3_circstring(), asgml3_compound(), asgml3_ptarray(), CIRCSTRINGTYPE, COMPOUNDTYPE, LWCURVEPOLY::flags, FLAGS_GET_Z, IS_DIMS, LINETYPE, LWCURVEPOLY::nrings, LWCURVEPOLY::rings, GML_Options::srs, stringbuffer_append(), and stringbuffer_aprintf().

Referenced by asgml3_multisurface(), and lwgeom_to_gml3().

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