PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ asgml3_curvepoly_size()

static size_t asgml3_curvepoly_size ( const LWCURVEPOLY poly,
const char *  srs,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1198 of file lwout_gml.c.

References asgml3_circstring_size(), asgml3_compound_size(), CIRCSTRINGTYPE, COMPOUNDTYPE, IS_DIMS, LINETYPE, LWCURVEPOLY::nrings, pointArray_GMLsize(), LWCURVEPOLY::rings, and LWGEOM::type.

Referenced by asgml3_curvepoly(), and asgml3_multisurface_size().

1199 {
1200  size_t prefixlen = strlen(prefix);
1201  LWGEOM* subgeom;
1202  size_t size = sizeof( "<Polygon></Polygon" ) + 2 * prefixlen;
1203  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1204  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1205  int i;
1206 
1207  for( i = 0; i < poly->nrings; ++i )
1208  {
1209  if( i == 0 )
1210  {
1211  size += sizeof( "<exterior></exterior>" ) + 2 * prefixlen;
1212  }
1213  else
1214  {
1215  size += sizeof( "<interior></interior>" ) + 2 * prefixlen;
1216  }
1217  subgeom = poly->rings[i];
1218 
1219  if ( subgeom->type == LINETYPE )
1220  {
1221  size += sizeof("<LinearRing></LinearRing>") + 2 * prefixlen;
1222  size += sizeof("<posList></posList") + 2 * prefixlen;
1223  if (IS_DIMS(opts))
1224  {
1225  size += sizeof(" srsDimension='x'");
1226  }
1227  size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1228  }
1229  else if( subgeom->type == CIRCSTRINGTYPE )
1230  {
1231  size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1232  size += sizeof("<CurveMember></CurveMember>") + 2 * prefixlen;
1233  size += asgml3_circstring_size((LWCIRCSTRING*)subgeom, srs, precision, opts, prefix, id);
1234  }
1235  else if( subgeom->type == COMPOUNDTYPE )
1236  {
1237  size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1238  size += sizeof("<curveMember></curveMember>") + 2 * prefixlen;
1239  size += asgml3_compound_size( (LWCOMPOUND*)subgeom, srs, precision, opts, prefix, id );
1240  }
1241  }
1242  return size;
1243 }
#define LINETYPE
Definition: liblwgeom.h:71
LWGEOM ** rings
Definition: liblwgeom.h:519
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
static size_t asgml3_compound_size(const LWCOMPOUND *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1083
#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
uint8_t type
Definition: liblwgeom.h:380
static size_t asgml3_circstring_size(const LWCIRCSTRING *circ, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:936
#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: