PostGIS  2.5.1dev-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 1192 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().

1193 {
1194  size_t prefixlen = strlen(prefix);
1195  LWGEOM* subgeom;
1196  size_t size = sizeof( "<Polygon></Polygon" ) + 2 * prefixlen;
1197  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1198  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1199  uint32_t i;
1200 
1201  for( i = 0; i < poly->nrings; ++i )
1202  {
1203  if( i == 0 )
1204  {
1205  size += sizeof( "<exterior></exterior>" ) + 2 * prefixlen;
1206  }
1207  else
1208  {
1209  size += sizeof( "<interior></interior>" ) + 2 * prefixlen;
1210  }
1211  subgeom = poly->rings[i];
1212 
1213  if ( subgeom->type == LINETYPE )
1214  {
1215  size += sizeof("<LinearRing></LinearRing>") + 2 * prefixlen;
1216  size += sizeof("<posList></posList") + 2 * prefixlen;
1217  if (IS_DIMS(opts))
1218  {
1219  size += sizeof(" srsDimension='x'");
1220  }
1221  size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1222  }
1223  else if( subgeom->type == CIRCSTRINGTYPE )
1224  {
1225  size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1226  size += sizeof("<CurveMember></CurveMember>") + 2 * prefixlen;
1227  size += asgml3_circstring_size((LWCIRCSTRING*)subgeom, srs, precision, opts, prefix, id);
1228  }
1229  else if( subgeom->type == COMPOUNDTYPE )
1230  {
1231  size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1232  size += sizeof("<curveMember></curveMember>") + 2 * prefixlen;
1233  size += asgml3_compound_size( (LWCOMPOUND*)subgeom, srs, precision, opts, prefix, id );
1234  }
1235  }
1236  return size;
1237 }
#define LINETYPE
Definition: liblwgeom.h:85
LWGEOM ** rings
Definition: liblwgeom.h:537
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
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:1077
unsigned int uint32_t
Definition: uthash.h:78
#define IS_DIMS(x)
Definition: liblwgeom.h:1550
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
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:930
uint32_t nrings
Definition: liblwgeom.h:535
#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: