PostGIS  2.5.1dev-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 1119 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().

1120 {
1121  LWGEOM *subgeom;
1122  uint32_t i;
1123  char* ptr = output;
1124  int dimension=2;
1125 
1126  if (FLAGS_GET_Z(col->flags))
1127  {
1128  dimension = 3;
1129  }
1130 
1131  ptr += sprintf( ptr, "<%sCurve", prefix );
1132  if (srs)
1133  {
1134  ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1135  }
1136  if (id)
1137  {
1138  ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1139  }
1140  ptr += sprintf( ptr, ">" );
1141  ptr += sprintf( ptr, "<%ssegments>", prefix );
1142 
1143  for( i = 0; i < col->ngeoms; ++i )
1144  {
1145  subgeom = col->geoms[i];
1146  if( subgeom->type != LINETYPE && subgeom->type != CIRCSTRINGTYPE )
1147  {
1148  continue;
1149  }
1150 
1151  if ( subgeom->type == LINETYPE )
1152  {
1153  ptr += sprintf( ptr, "<%sLineStringSegment><%sposList", prefix, prefix );
1154  if (IS_DIMS(opts))
1155  {
1156  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1157  }
1158  ptr += sprintf(ptr, ">");
1159  ptr += pointArray_toGML3(((LWCIRCSTRING*)subgeom)->points, ptr, precision, opts);
1160  ptr += sprintf( ptr, "</%sposList></%sLineStringSegment>", prefix, prefix );
1161  }
1162  else if( subgeom->type == CIRCSTRINGTYPE )
1163  {
1164  ptr += sprintf( ptr, "<%sArcString><%sposList" , prefix, prefix );
1165  if (IS_DIMS(opts))
1166  {
1167  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1168  }
1169  ptr += sprintf(ptr, ">");
1170  ptr += pointArray_toGML3(((LWLINE*)subgeom)->points, ptr, precision, opts);
1171  ptr += sprintf( ptr, "</%sposList></%sArcString>", prefix, prefix );
1172  }
1173  }
1174 
1175  ptr += sprintf( ptr, "</%ssegments>", prefix );
1176  ptr += sprintf( ptr, "</%sCurve>", prefix );
1177  return ( ptr - output );
1178 }
#define LINETYPE
Definition: liblwgeom.h:85
LWGEOM ** geoms
Definition: liblwgeom.h:524
uint8_t flags
Definition: liblwgeom.h:519
unsigned int uint32_t
Definition: uthash.h:78
#define IS_DIMS(x)
Definition: liblwgeom.h:1550
uint32_t ngeoms
Definition: liblwgeom.h:522
uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the &#39;flags&#39; byte.
Definition: liblwgeom.h:139
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1890
uint8_t type
Definition: liblwgeom.h:398
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: