PostGIS  2.2.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 1125 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().

1126 {
1127  LWGEOM *subgeom;
1128  int i;
1129  char* ptr = output;
1130  int dimension=2;
1131 
1132  if (FLAGS_GET_Z(col->flags))
1133  {
1134  dimension = 3;
1135  }
1136 
1137  ptr += sprintf( ptr, "<%sCurve", prefix );
1138  if (srs)
1139  {
1140  ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1141  }
1142  if (id)
1143  {
1144  ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1145  }
1146  ptr += sprintf( ptr, ">" );
1147  ptr += sprintf( ptr, "<%ssegments>", prefix );
1148 
1149  for( i = 0; i < col->ngeoms; ++i )
1150  {
1151  subgeom = col->geoms[i];
1152  if( subgeom->type != LINETYPE && subgeom->type != CIRCSTRINGTYPE )
1153  {
1154  continue;
1155  }
1156 
1157  if ( subgeom->type == LINETYPE )
1158  {
1159  ptr += sprintf( ptr, "<%sLineStringSegment><%sposList", prefix, prefix );
1160  if (IS_DIMS(opts))
1161  {
1162  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1163  }
1164  ptr += sprintf(ptr, ">");
1165  ptr += pointArray_toGML3(((LWCIRCSTRING*)subgeom)->points, ptr, precision, opts);
1166  ptr += sprintf( ptr, "</%sposList></%sLineStringSegment>", prefix, prefix );
1167  }
1168  else if( subgeom->type == CIRCSTRINGTYPE )
1169  {
1170  ptr += sprintf( ptr, "<%sArcString><%sposList" , prefix, prefix );
1171  if (IS_DIMS(opts))
1172  {
1173  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1174  }
1175  ptr += sprintf(ptr, ">");
1176  ptr += pointArray_toGML3(((LWLINE*)subgeom)->points, ptr, precision, opts);
1177  ptr += sprintf( ptr, "</%sposList></%sArcString>", prefix, prefix );
1178  }
1179  }
1180 
1181  ptr += sprintf( ptr, "</%ssegments>", prefix );
1182  ptr += sprintf( ptr, "</%sCurve>", prefix );
1183  return ( ptr - output );
1184 }
#define LINETYPE
Definition: liblwgeom.h:71
LWGEOM ** geoms
Definition: liblwgeom.h:506
uint8_t flags
Definition: liblwgeom.h:501
#define IS_DIMS(x)
Definition: liblwgeom.h:1478
uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
int ngeoms
Definition: liblwgeom.h:504
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1896
uint8_t type
Definition: liblwgeom.h:380
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77

Here is the call graph for this function:

Here is the caller graph for this function: