PostGIS  2.4.9dev-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 1211 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().

1212 {
1213  size_t prefixlen = strlen(prefix);
1214  LWGEOM* subgeom;
1215  size_t size = sizeof( "<Polygon></Polygon" ) + 2 * prefixlen;
1216  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1217  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1218  int i;
1219 
1220  for( i = 0; i < poly->nrings; ++i )
1221  {
1222  if( i == 0 )
1223  {
1224  size += sizeof( "<exterior></exterior>" ) + 2 * prefixlen;
1225  }
1226  else
1227  {
1228  size += sizeof( "<interior></interior>" ) + 2 * prefixlen;
1229  }
1230  subgeom = poly->rings[i];
1231 
1232  if ( subgeom->type == LINETYPE )
1233  {
1234  size += sizeof("<LinearRing></LinearRing>") + 2 * prefixlen;
1235  size += sizeof("<posList></posList") + 2 * prefixlen;
1236  if (IS_DIMS(opts))
1237  {
1238  size += sizeof(" srsDimension='x'");
1239  }
1240  size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1241  }
1242  else if( subgeom->type == CIRCSTRINGTYPE )
1243  {
1244  size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1245  size += sizeof("<CurveMember></CurveMember>") + 2 * prefixlen;
1246  size += asgml3_circstring_size((LWCIRCSTRING*)subgeom, srs, precision, opts, prefix, id);
1247  }
1248  else if( subgeom->type == COMPOUNDTYPE )
1249  {
1250  size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1251  size += sizeof("<curveMember></curveMember>") + 2 * prefixlen;
1252  size += asgml3_compound_size( (LWCOMPOUND*)subgeom, srs, precision, opts, prefix, id );
1253  }
1254  }
1255  return size;
1256 }
#define LINETYPE
Definition: liblwgeom.h:86
LWGEOM ** rings
Definition: liblwgeom.h:535
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
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:1096
#define IS_DIMS(x)
Definition: liblwgeom.h:1544
uint8_t precision
Definition: cu_in_twkb.c:25
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1987
uint8_t type
Definition: liblwgeom.h:396
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:949
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: