PostGIS  3.1.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 1132 of file lwout_gml.c.

1133 {
1134  LWGEOM *subgeom;
1135  uint32_t i;
1136  char* ptr = output;
1137  int dimension=2;
1138 
1139  if (FLAGS_GET_Z(col->flags))
1140  {
1141  dimension = 3;
1142  }
1143 
1144  ptr += sprintf( ptr, "<%sCurve", prefix );
1145  if (srs)
1146  {
1147  ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1148  }
1149  if (id)
1150  {
1151  ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1152  }
1153  ptr += sprintf( ptr, ">" );
1154  ptr += sprintf( ptr, "<%ssegments>", prefix );
1155 
1156  for( i = 0; i < col->ngeoms; ++i )
1157  {
1158  subgeom = col->geoms[i];
1159  if( subgeom->type != LINETYPE && subgeom->type != CIRCSTRINGTYPE )
1160  {
1161  continue;
1162  }
1163 
1164  if ( subgeom->type == LINETYPE )
1165  {
1166  ptr += sprintf( ptr, "<%sLineStringSegment><%sposList", prefix, prefix );
1167  if (IS_DIMS(opts))
1168  {
1169  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1170  }
1171  ptr += sprintf(ptr, ">");
1172  ptr += pointArray_toGML3(((LWCIRCSTRING*)subgeom)->points, ptr, precision, opts);
1173  ptr += sprintf( ptr, "</%sposList></%sLineStringSegment>", prefix, prefix );
1174  }
1175  else if( subgeom->type == CIRCSTRINGTYPE )
1176  {
1177  ptr += sprintf( ptr, "<%sArcString><%sposList" , prefix, prefix );
1178  if (IS_DIMS(opts))
1179  {
1180  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1181  }
1182  ptr += sprintf(ptr, ">");
1183  ptr += pointArray_toGML3(((LWLINE*)subgeom)->points, ptr, precision, opts);
1184  ptr += sprintf( ptr, "</%sposList></%sArcString>", prefix, prefix );
1185  }
1186  }
1187 
1188  ptr += sprintf( ptr, "</%ssegments>", prefix );
1189  ptr += sprintf( ptr, "</%sCurve>", prefix );
1190  return ( ptr - output );
1191 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define IS_DIMS(x)
Definition: liblwgeom.h:1682
#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:1897
opts
Definition: ovdump.py:45
lwflags_t flags
Definition: liblwgeom.h:605
uint32_t ngeoms
Definition: liblwgeom.h:608
LWGEOM ** geoms
Definition: liblwgeom.h:603
uint8_t type
Definition: liblwgeom.h:476

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: