PostGIS  2.3.7dev-r@@SVN_REVISION@@
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 1138 of file lwout_gml.c.

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

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

1139 {
1140  LWGEOM *subgeom;
1141  int i;
1142  char* ptr = output;
1143  int dimension=2;
1144 
1145  if (FLAGS_GET_Z(col->flags))
1146  {
1147  dimension = 3;
1148  }
1149 
1150  ptr += sprintf( ptr, "<%sCurve", prefix );
1151  if (srs)
1152  {
1153  ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1154  }
1155  if (id)
1156  {
1157  ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1158  }
1159  ptr += sprintf( ptr, ">" );
1160  ptr += sprintf( ptr, "<%ssegments>", prefix );
1161 
1162  for( i = 0; i < col->ngeoms; ++i )
1163  {
1164  subgeom = col->geoms[i];
1165  if( subgeom->type != LINETYPE && subgeom->type != CIRCSTRINGTYPE )
1166  {
1167  continue;
1168  }
1169 
1170  if ( subgeom->type == LINETYPE )
1171  {
1172  ptr += sprintf( ptr, "<%sLineStringSegment><%sposList", prefix, prefix );
1173  if (IS_DIMS(opts))
1174  {
1175  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1176  }
1177  ptr += sprintf(ptr, ">");
1178  ptr += pointArray_toGML3(((LWCIRCSTRING*)subgeom)->points, ptr, precision, opts);
1179  ptr += sprintf( ptr, "</%sposList></%sLineStringSegment>", prefix, prefix );
1180  }
1181  else if( subgeom->type == CIRCSTRINGTYPE )
1182  {
1183  ptr += sprintf( ptr, "<%sArcString><%sposList" , prefix, prefix );
1184  if (IS_DIMS(opts))
1185  {
1186  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1187  }
1188  ptr += sprintf(ptr, ">");
1189  ptr += pointArray_toGML3(((LWLINE*)subgeom)->points, ptr, precision, opts);
1190  ptr += sprintf( ptr, "</%sposList></%sArcString>", prefix, prefix );
1191  }
1192  }
1193 
1194  ptr += sprintf( ptr, "</%ssegments>", prefix );
1195  ptr += sprintf( ptr, "</%sCurve>", prefix );
1196  return ( ptr - output );
1197 }
#define LINETYPE
Definition: liblwgeom.h:85
LWGEOM ** geoms
Definition: liblwgeom.h:521
uint8_t flags
Definition: liblwgeom.h:516
#define IS_DIMS(x)
Definition: liblwgeom.h:1522
uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:139
int ngeoms
Definition: liblwgeom.h:519
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1909
uint8_t type
Definition: liblwgeom.h:395
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91

Here is the call graph for this function:

Here is the caller graph for this function: