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

◆ asgml3_compound()

static void asgml3_compound ( stringbuffer_t sb,
const LWCOMPOUND col,
const GML_Options opts 
)
static

Definition at line 540 of file lwout_gml.c.

541{
542 LWGEOM *subgeom;
543 uint32_t i;
544 int dimension = FLAGS_GET_Z(col->flags) ? 3 : 2;
545
546 stringbuffer_aprintf(sb, "<%sCurve", opts->prefix);
547 if (opts->srs) stringbuffer_aprintf(sb, " srsName=\"%s\"", opts->srs);
548 if (opts->id) stringbuffer_aprintf(sb, " %sid=\"%s\"", opts->prefix, opts->id);
549 stringbuffer_append(sb, ">");
550 stringbuffer_aprintf(sb, "<%ssegments>", opts->prefix);
551
552 for (i = 0; i < col->ngeoms; ++i)
553 {
554 subgeom = col->geoms[i];
555
556 if (subgeom->type != LINETYPE && subgeom->type != CIRCSTRINGTYPE)
557 continue;
558
559 if (subgeom->type == LINETYPE)
560 {
561 stringbuffer_aprintf(sb, "<%sLineStringSegment>", opts->prefix);
562 stringbuffer_aprintf(sb, "<%sposList", opts->prefix);
563 if (IS_DIMS(opts->opts))
564 stringbuffer_aprintf(sb, " srsDimension=\"%d\"", dimension);
565
566 stringbuffer_append(sb, ">");
567 asgml3_ptarray(sb, ((LWCIRCSTRING*)subgeom)->points, opts);
568 stringbuffer_aprintf(sb, "</%sposList>", opts->prefix);
569 stringbuffer_aprintf(sb, "</%sLineStringSegment>", opts->prefix);
570 }
571 else if( subgeom->type == CIRCSTRINGTYPE )
572 {
573 stringbuffer_aprintf(sb, "<%sArcString>", opts->prefix);
574 stringbuffer_aprintf(sb, "<%sposList", opts->prefix);
575 if (IS_DIMS(opts->opts))
576 {
577 stringbuffer_aprintf(sb, " srsDimension=\"%d\"", dimension);
578 }
579 stringbuffer_append(sb, ">");
580 asgml3_ptarray(sb, ((LWLINE*)subgeom)->points, opts);
581 stringbuffer_aprintf(sb, "</%sposList>", opts->prefix);
582 stringbuffer_aprintf(sb, "</%sArcString>", opts->prefix);
583 }
584 }
585 stringbuffer_aprintf(sb, "</%ssegments>", opts->prefix);
586 stringbuffer_aprintf(sb, "</%sCurve>", opts->prefix);
587}
#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_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.
lwflags_t flags
Definition liblwgeom.h:591
uint32_t ngeoms
Definition liblwgeom.h:594
LWGEOM ** geoms
Definition liblwgeom.h:589
uint8_t type
Definition liblwgeom.h:462

References asgml3_ptarray(), CIRCSTRINGTYPE, LWCOMPOUND::flags, FLAGS_GET_Z, LWCOMPOUND::geoms, IS_DIMS, LINETYPE, LWCOMPOUND::ngeoms, stringbuffer_append(), stringbuffer_aprintf(), and LWGEOM::type.

Referenced by asgml3_curvepoly(), asgml3_multicurve(), and lwgeom_to_gml3().

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