PostGIS  2.5.0dev-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 1077 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().

1078 {
1079  uint32_t i;
1080  size_t size;
1081  LWGEOM *subgeom;
1082  size_t prefixlen = strlen(prefix);
1083 
1084  size = ( sizeof( "<Curve></Curve>" ) + 2 * prefixlen );
1085 
1086  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1087  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1088 
1089  size += ( sizeof("<segments></segments>") + 2 * prefixlen );
1090 
1091  for(i= 0; i < col->ngeoms; ++i )
1092  {
1093  subgeom = col->geoms[i];
1094  if ( subgeom->type == LINETYPE )
1095  {
1096 
1097  size += sizeof( "<LineStringSegment></LineStringSegment" ) + 2 * prefixlen;
1098  size += sizeof( "<posList></posList" ) + 2 * prefixlen;
1099  size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1100  }
1101  else if( subgeom->type == CIRCSTRINGTYPE )
1102  {
1103  size += sizeof( "<ArcString><posList></ArcString></posList>") + 4 * prefixlen;
1104  size += pointArray_GMLsize( ((LWCIRCSTRING*)subgeom)->points, precision );
1105  }
1106  else
1107  {
1108  continue;
1109  }
1110  if (IS_DIMS(opts))
1111  {
1112  size += sizeof(" srsDimension='x'");
1113  }
1114  }
1115  return size;
1116 }
#define LINETYPE
Definition: liblwgeom.h:85
LWGEOM ** geoms
Definition: liblwgeom.h:524
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
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1949
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: