PostGIS  3.3.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 1090 of file lwout_gml.c.

1091 {
1092  uint32_t i;
1093  size_t size;
1094  LWGEOM *subgeom;
1095  size_t prefixlen = strlen(prefix);
1096 
1097  size = ( sizeof( "<Curve></Curve>" ) + 2 * prefixlen );
1098 
1099  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1100  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1101 
1102  size += ( sizeof("<segments></segments>") + 2 * prefixlen );
1103 
1104  for(i= 0; i < col->ngeoms; ++i )
1105  {
1106  subgeom = col->geoms[i];
1107  if ( subgeom->type == LINETYPE )
1108  {
1109 
1110  size += sizeof( "<LineStringSegment></LineStringSegment" ) + 2 * prefixlen;
1111  size += sizeof( "<posList></posList" ) + 2 * prefixlen;
1112  size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1113  }
1114  else if( subgeom->type == CIRCSTRINGTYPE )
1115  {
1116  size += sizeof( "<ArcString><posList></ArcString></posList>") + 4 * prefixlen;
1117  size += pointArray_GMLsize( ((LWCIRCSTRING*)subgeom)->points, precision );
1118  }
1119  else
1120  {
1121  continue;
1122  }
1123  if (IS_DIMS(opts))
1124  {
1125  size += sizeof(" srsDimension='x'");
1126  }
1127  }
1128  return size;
1129 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define IS_DIMS(x)
Definition: liblwgeom.h:1699
#define LINETYPE
Definition: liblwgeom.h:118
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:124
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1950
opts
Definition: ovdump.py:45
uint32_t ngeoms
Definition: liblwgeom.h:609
LWGEOM ** geoms
Definition: liblwgeom.h:604
uint8_t type
Definition: liblwgeom.h:477

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

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

Here is the call graph for this function:
Here is the caller graph for this function: