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

◆ 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 1191 of file lwout_gml.c.

1192{
1193 size_t prefixlen = strlen(prefix);
1194 LWGEOM* subgeom;
1195 size_t size = sizeof( "<Polygon></Polygon" ) + 2 * prefixlen;
1196 if (srs) size += strlen(srs) + sizeof(" srsName=..");
1197 if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1198 uint32_t i;
1199
1200 for( i = 0; i < poly->nrings; ++i )
1201 {
1202 if( i == 0 )
1203 {
1204 size += sizeof( "<exterior></exterior>" ) + 2 * prefixlen;
1205 }
1206 else
1207 {
1208 size += sizeof( "<interior></interior>" ) + 2 * prefixlen;
1209 }
1210 subgeom = poly->rings[i];
1211
1212 if ( subgeom->type == LINETYPE )
1213 {
1214 size += sizeof("<LinearRing></LinearRing>") + 2 * prefixlen;
1215 size += sizeof("<posList></posList") + 2 * prefixlen;
1216 if (IS_DIMS(opts))
1217 {
1218 size += sizeof(" srsDimension='x'");
1219 }
1220 size += pointArray_GMLsize( ((LWLINE*)subgeom)->points, precision );
1221 }
1222 else if( subgeom->type == CIRCSTRINGTYPE )
1223 {
1224 size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1225 size += sizeof("<CurveMember></CurveMember>") + 2 * prefixlen;
1226 size += asgml3_circstring_size((LWCIRCSTRING*)subgeom, srs, precision, opts, prefix, id);
1227 }
1228 else if( subgeom->type == COMPOUNDTYPE )
1229 {
1230 size += sizeof("<Ring></Ring>") + 2 * prefixlen;
1231 size += sizeof("<curveMember></curveMember>") + 2 * prefixlen;
1232 size += asgml3_compound_size( (LWCOMPOUND*)subgeom, srs, precision, opts, prefix, id );
1233 }
1234 }
1235 return size;
1236}
static uint8_t precision
Definition cu_in_twkb.c:25
#define COMPOUNDTYPE
Definition liblwgeom.h:124
#define IS_DIMS(x)
Definition liblwgeom.h:1657
#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:929
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition lwout_gml.c:1947
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:1076
LWGEOM ** rings
Definition liblwgeom.h:589
uint32_t nrings
Definition liblwgeom.h:594
uint8_t type
Definition liblwgeom.h:448

References asgml3_circstring_size(), asgml3_compound_size(), CIRCSTRINGTYPE, COMPOUNDTYPE, IS_DIMS, LINETYPE, LWCURVEPOLY::nrings, 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: