PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ asgml3_compound_size()

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

Definition at line 1096 of file lwout_gml.c.

References CIRCSTRINGTYPE, LWCOMPOUND::geoms, IS_DIMS, LINETYPE, LWCOMPOUND::ngeoms, pointArray_GMLsize(), and LWGEOM::type.

Referenced by asgml3_compound(), asgml3_curvepoly_size(), and asgml3_multicurve_size().

1097 {
1098  int i;
1099  size_t size;
1100  LWGEOM *subgeom;
1101  size_t prefixlen = strlen(prefix);
1102 
1103  size = ( sizeof( "<Curve></Curve>" ) + 2 * prefixlen );
1104 
1105  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1106  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1107 
1108  size += ( sizeof("<segments></segments>") + 2 * prefixlen );
1109 
1110  for(i= 0; i < col->ngeoms; ++i )
1111  {
1112  subgeom = col->geoms[i];
1113  if ( subgeom->type == LINETYPE )
1114  {
1115 
1116  size += sizeof( "<LineStringSegment></LineStringSegment" ) + 2 * prefixlen;
1117  size += sizeof( "<posList></posList" ) + 2 * prefixlen;
1118  size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1119  }
1120  else if( subgeom->type == CIRCSTRINGTYPE )
1121  {
1122  size += sizeof( "<ArcString><posList></ArcString></posList>") + 4 * prefixlen;
1123  size += pointArray_GMLsize( ((LWCIRCSTRING*)subgeom)->points, precision );
1124  }
1125  else
1126  {
1127  continue;
1128  }
1129  if (IS_DIMS(opts))
1130  {
1131  size += sizeof(" srsDimension='x'");
1132  }
1133  }
1134  return size;
1135 }
#define LINETYPE
Definition: liblwgeom.h:86
LWGEOM ** geoms
Definition: liblwgeom.h:522
#define IS_DIMS(x)
Definition: liblwgeom.h:1544
uint8_t precision
Definition: cu_in_twkb.c:25
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1987
int ngeoms
Definition: liblwgeom.h:520
uint8_t type
Definition: liblwgeom.h:396
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: