PostGIS  3.1.6dev-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 1203 of file lwout_gml.c.

1204 {
1205  size_t prefixlen = strlen(prefix);
1206  LWGEOM* subgeom;
1207  size_t size = sizeof( "<Polygon></Polygon" ) + 2 * prefixlen;
1208  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1209  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1210  uint32_t i;
1211 
1212  for( i = 0; i < poly->nrings; ++i )
1213  {
1214  if( i == 0 )
1215  {
1216  size += sizeof( "<exterior></exterior>" ) + 2 * prefixlen;
1217  }
1218  else
1219  {
1220  size += sizeof( "<interior></interior>" ) + 2 * prefixlen;
1221  }
1222  subgeom = poly->rings[i];
1223 
1224  if ( subgeom->type == LINETYPE )
1225  {
1226  size += sizeof("<LinearRing></LinearRing>") + 2 * prefixlen;
1227  size += sizeof("<posList></posList") + 2 * prefixlen;
1228  if (IS_DIMS(opts))
1229  {
1230  size += sizeof(" srsDimension='x'");
1231  }
1232  size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1233  }
1234  else if( subgeom->type == CIRCSTRINGTYPE )
1235  {
1236  size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1237  size += sizeof("<CurveMember></CurveMember>") + 2 * prefixlen;
1238  size += asgml3_circstring_size((LWCIRCSTRING*)subgeom, srs, precision, opts, prefix, id);
1239  }
1240  else if( subgeom->type == COMPOUNDTYPE )
1241  {
1242  size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1243  size += sizeof("<curveMember></curveMember>") + 2 * prefixlen;
1244  size += asgml3_compound_size( (LWCOMPOUND*)subgeom, srs, precision, opts, prefix, id );
1245  }
1246  }
1247  return size;
1248 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define COMPOUNDTYPE
Definition: liblwgeom.h:124
#define IS_DIMS(x)
Definition: liblwgeom.h:1682
#define LINETYPE
Definition: liblwgeom.h:117
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:123
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
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1950
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:1090
opts
Definition: ovdump.py:45
LWGEOM ** rings
Definition: liblwgeom.h:617
uint32_t nrings
Definition: liblwgeom.h:622
uint8_t type
Definition: liblwgeom.h:476

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: