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

◆ asgml3_compound_size()

static size_t asgml3_compound_size ( const LWCOMPOUND col,
const char *  srs,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1076 of file lwout_gml.c.

1077{
1078 uint32_t i;
1079 size_t size;
1080 LWGEOM *subgeom;
1081 size_t prefixlen = strlen(prefix);
1082
1083 size = ( sizeof( "<Curve></Curve>" ) + 2 * prefixlen );
1084
1085 if (srs) size += strlen(srs) + sizeof(" srsName=..");
1086 if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1087
1088 size += ( sizeof("<segments></segments>") + 2 * prefixlen );
1089
1090 for(i= 0; i < col->ngeoms; ++i )
1091 {
1092 subgeom = col->geoms[i];
1093 if ( subgeom->type == LINETYPE )
1094 {
1095
1096 size += sizeof( "<LineStringSegment></LineStringSegment" ) + 2 * prefixlen;
1097 size += sizeof( "<posList></posList" ) + 2 * prefixlen;
1098 size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1099 }
1100 else if( subgeom->type == CIRCSTRINGTYPE )
1101 {
1102 size += sizeof( "<ArcString><posList></ArcString></posList>") + 4 * prefixlen;
1103 size += pointArray_GMLsize( ((LWCIRCSTRING*)subgeom)->points, precision );
1104 }
1105 else
1106 {
1107 continue;
1108 }
1109 if (IS_DIMS(opts))
1110 {
1111 size += sizeof(" srsDimension='x'");
1112 }
1113 }
1114 return size;
1115}
static uint8_t precision
Definition cu_in_twkb.c:25
#define IS_DIMS(x)
Definition liblwgeom.h:1657
#define LINETYPE
Definition liblwgeom.h:117
#define CIRCSTRINGTYPE
Definition liblwgeom.h:123
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition lwout_gml.c:1947
uint32_t ngeoms
Definition liblwgeom.h:580
LWGEOM ** geoms
Definition liblwgeom.h:575
uint8_t type
Definition liblwgeom.h:448

References CIRCSTRINGTYPE, LWCOMPOUND::geoms, IS_DIMS, LINETYPE, LWCOMPOUND::ngeoms, pointArray_GMLsize(), precision, and LWGEOM::type.

Referenced by asgml3_compound(), asgml3_curvepoly_size(), and asgml3_multicurve_size().

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