PostGIS  2.2.8dev-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 1083 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().

1084 {
1085  int i;
1086  size_t size;
1087  LWGEOM *subgeom;
1088  size_t prefixlen = strlen(prefix);
1089 
1090  size = ( sizeof( "<Curve></Curve>" ) + 2 * prefixlen );
1091 
1092  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1093  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1094 
1095  size += ( sizeof("<segments></segments>") + 2 * prefixlen );
1096 
1097  for(i= 0; i < col->ngeoms; ++i )
1098  {
1099  subgeom = col->geoms[i];
1100  if ( subgeom->type == LINETYPE )
1101  {
1102 
1103  size += sizeof( "<LineStringSegment></LineStringSegment" ) + 2 * prefixlen;
1104  size += sizeof( "<posList></posList" ) + 2 * prefixlen;
1105  size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1106  }
1107  else if( subgeom->type == CIRCSTRINGTYPE )
1108  {
1109  size += sizeof( "<ArcString><posList></ArcString></posList>") + 4 * prefixlen;
1110  size += pointArray_GMLsize( ((LWCIRCSTRING*)subgeom)->points, precision );
1111  }
1112  else
1113  {
1114  continue;
1115  }
1116  if (IS_DIMS(opts))
1117  {
1118  size += sizeof(" srsDimension='x'");
1119  }
1120  }
1121  return size;
1122 }
#define LINETYPE
Definition: liblwgeom.h:71
LWGEOM ** geoms
Definition: liblwgeom.h:506
#define IS_DIMS(x)
Definition: liblwgeom.h:1478
uint8_t precision
Definition: cu_in_twkb.c:25
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1974
int ngeoms
Definition: liblwgeom.h:504
uint8_t type
Definition: liblwgeom.h:380
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: