PostGIS  2.5.7dev-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.

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 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define IS_DIMS(x)
Definition: liblwgeom.h:1551
#define LINETYPE
Definition: liblwgeom.h:86
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
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
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1949
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
opts
Definition: ovdump.py:44
LWGEOM ** rings
Definition: liblwgeom.h:538
uint32_t nrings
Definition: liblwgeom.h:536
uint8_t type
Definition: liblwgeom.h:399
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by asgml3_curvepoly(), and asgml3_multisurface_size().

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