PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ asgml2_multi_size()

static size_t asgml2_multi_size ( const LWCOLLECTION col,
const char *  srs,
int  precision,
const char *  prefix 
)
static

Definition at line 451 of file lwout_gml.c.

453 {
454  uint32_t i;
455  size_t size;
456  size_t prefixlen = strlen(prefix);
457  LWGEOM *subgeom;
458 
459  /* the longest possible multi version */
460  size = sizeof("<MultiLineString></MultiLineString>");
461  size += 2*prefixlen;
462 
463  if ( srs ) size += strlen(srs) + sizeof(" srsName=..");
464 
465  for (i=0; i<col->ngeoms; i++)
466  {
467  subgeom = col->geoms[i];
468  if (subgeom->type == POINTTYPE)
469  {
470  size += ( sizeof("<pointMember>/") + prefixlen ) * 2;
471  size += asgml2_point_size((LWPOINT*)subgeom, 0, precision, prefix);
472  }
473  else if (subgeom->type == LINETYPE)
474  {
475  size += ( sizeof("<lineStringMember>/") + prefixlen ) * 2;
476  size += asgml2_line_size((LWLINE*)subgeom, 0, precision, prefix);
477  }
478  else if (subgeom->type == POLYGONTYPE)
479  {
480  size += ( sizeof("<polygonMember>/") + prefixlen ) * 2;
481  size += asgml2_poly_size((LWPOLY*)subgeom, 0, precision, prefix);
482  }
483  }
484 
485  return size;
486 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define LINETYPE
Definition: liblwgeom.h:117
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:116
#define POLYGONTYPE
Definition: liblwgeom.h:118
static size_t asgml2_point_size(const LWPOINT *point, const char *srs, int precision, const char *prefix)
Definition: lwout_gml.c:299
static size_t asgml2_line_size(const LWLINE *line, const char *srs, int precision, const char *prefix)
Definition: lwout_gml.c:341
static size_t asgml2_poly_size(const LWPOLY *poly, const char *srs, int precision, const char *prefix)
Definition: lwout_gml.c:386
uint32_t ngeoms
Definition: liblwgeom.h:594
LWGEOM ** geoms
Definition: liblwgeom.h:589
uint8_t type
Definition: liblwgeom.h:476

References asgml2_line_size(), asgml2_point_size(), asgml2_poly_size(), LWCOLLECTION::geoms, LINETYPE, LWCOLLECTION::ngeoms, POINTTYPE, POLYGONTYPE, precision, and LWGEOM::type.

Referenced by asgml2_multi().

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