PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ asgml3_compound_buf()

static size_t asgml3_compound_buf ( const LWCOMPOUND col,
const char *  srs,
char *  output,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1118 of file lwout_gml.c.

1119 {
1120  LWGEOM *subgeom;
1121  uint32_t i;
1122  char* ptr = output;
1123  int dimension=2;
1124 
1125  if (FLAGS_GET_Z(col->flags))
1126  {
1127  dimension = 3;
1128  }
1129 
1130  ptr += sprintf( ptr, "<%sCurve", prefix );
1131  if (srs)
1132  {
1133  ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1134  }
1135  if (id)
1136  {
1137  ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1138  }
1139  ptr += sprintf( ptr, ">" );
1140  ptr += sprintf( ptr, "<%ssegments>", prefix );
1141 
1142  for( i = 0; i < col->ngeoms; ++i )
1143  {
1144  subgeom = col->geoms[i];
1145  if( subgeom->type != LINETYPE && subgeom->type != CIRCSTRINGTYPE )
1146  {
1147  continue;
1148  }
1149 
1150  if ( subgeom->type == LINETYPE )
1151  {
1152  ptr += sprintf( ptr, "<%sLineStringSegment><%sposList", prefix, prefix );
1153  if (IS_DIMS(opts))
1154  {
1155  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1156  }
1157  ptr += sprintf(ptr, ">");
1158  ptr += pointArray_toGML3(((LWCIRCSTRING*)subgeom)->points, ptr, precision, opts);
1159  ptr += sprintf( ptr, "</%sposList></%sLineStringSegment>", prefix, prefix );
1160  }
1161  else if( subgeom->type == CIRCSTRINGTYPE )
1162  {
1163  ptr += sprintf( ptr, "<%sArcString><%sposList" , prefix, prefix );
1164  if (IS_DIMS(opts))
1165  {
1166  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1167  }
1168  ptr += sprintf(ptr, ">");
1169  ptr += pointArray_toGML3(((LWLINE*)subgeom)->points, ptr, precision, opts);
1170  ptr += sprintf( ptr, "</%sposList></%sArcString>", prefix, prefix );
1171  }
1172  }
1173 
1174  ptr += sprintf( ptr, "</%ssegments>", prefix );
1175  ptr += sprintf( ptr, "</%sCurve>", prefix );
1176  return ( ptr - output );
1177 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define IS_DIMS(x)
Definition: liblwgeom.h:1657
#define LINETYPE
Definition: liblwgeom.h:117
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:179
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:123
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1889
opts
Definition: ovdump.py:45
lwflags_t flags
Definition: liblwgeom.h:577
uint32_t ngeoms
Definition: liblwgeom.h:580
LWGEOM ** geoms
Definition: liblwgeom.h:575
uint8_t type
Definition: liblwgeom.h:448

References CIRCSTRINGTYPE, LWCOMPOUND::flags, FLAGS_GET_Z, LWCOMPOUND::geoms, IS_DIMS, LINETYPE, LWCOMPOUND::ngeoms, ovdump::opts, pointArray_toGML3(), precision, and LWGEOM::type.

Referenced by asgml3_compound(), asgml3_curvepoly_buf(), and asgml3_multicurve_buf().

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