PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ asgml3_multi_size()

static size_t asgml3_multi_size ( const LWCOLLECTION col,
const char *  srs,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1390 of file lwout_gml.c.

1391{
1392 uint32_t i;
1393 size_t size;
1394 size_t prefixlen = strlen(prefix);
1395 LWGEOM *subgeom;
1396
1397 /* the longest possible multi version */
1398 size = sizeof("<MultiLineString></MultiLineString>") + prefixlen*2;
1399
1400 if (srs) size += strlen(srs) + sizeof(" srsName=..");
1401 if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1402
1403 for (i=0; i<col->ngeoms; i++)
1404 {
1405 subgeom = col->geoms[i];
1406 if (subgeom->type == POINTTYPE)
1407 {
1408 size += ( sizeof("<pointMember>/") + prefixlen ) * 2;
1409 size += asgml3_point_size((LWPOINT*)subgeom, 0, precision, opts, prefix, id);
1410 }
1411 else if (subgeom->type == LINETYPE)
1412 {
1413 size += ( sizeof("<curveMember>/") + prefixlen ) * 2;
1414 size += asgml3_line_size((LWLINE*)subgeom, 0, precision, opts, prefix, id);
1415 }
1416 else if (subgeom->type == POLYGONTYPE)
1417 {
1418 size += ( sizeof("<surfaceMember>/") + prefixlen ) * 2;
1419 size += asgml3_poly_size((LWPOLY*)subgeom, 0, precision, opts, prefix, id);
1420 }
1421 }
1422
1423 return size;
1424}
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 asgml3_poly_size(const LWPOLY *poly, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition lwout_gml.c:994
static size_t asgml3_point_size(const LWPOINT *point, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition lwout_gml.c:774
static size_t asgml3_line_size(const LWLINE *line, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition lwout_gml.c:827
uint32_t ngeoms
Definition liblwgeom.h:566
LWGEOM ** geoms
Definition liblwgeom.h:561
uint8_t type
Definition liblwgeom.h:448

References asgml3_line_size(), asgml3_point_size(), asgml3_poly_size(), LWCOLLECTION::geoms, LINETYPE, LWCOLLECTION::ngeoms, POINTTYPE, POLYGONTYPE, precision, and LWGEOM::type.

Referenced by asgml3_collection_size(), and asgml3_multi().

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