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

◆ asgml3_curvepoly_buf()

static size_t asgml3_curvepoly_buf ( const LWCURVEPOLY poly,
const char *  srs,
char *  output,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1238 of file lwout_gml.c.

1239{
1240 uint32_t i;
1241 LWGEOM* subgeom;
1242 char *ptr=output;
1243 int dimension=2;
1244
1245 if (FLAGS_GET_Z(poly->flags))
1246 {
1247 dimension = 3;
1248 }
1249
1250 ptr += sprintf( ptr, "<%sPolygon", prefix );
1251 if (srs)
1252 {
1253 ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1254 }
1255 if (id)
1256 {
1257 ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1258 }
1259 ptr += sprintf(ptr, ">");
1260
1261 for( i = 0; i < poly->nrings; ++i )
1262 {
1263 if( i == 0 )
1264 {
1265 ptr += sprintf( ptr, "<%sexterior>", prefix);
1266 }
1267 else
1268 {
1269 ptr += sprintf( ptr, "<%sinterior>", prefix);
1270 }
1271
1272 subgeom = poly->rings[i];
1273 if ( subgeom->type == LINETYPE )
1274 {
1275 ptr += sprintf( ptr, "<%sLinearRing>", prefix );
1276 ptr += sprintf( ptr, "<%sposList", prefix );
1277 if (IS_DIMS(opts))
1278 {
1279 ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1280 }
1281 ptr += sprintf( ptr, ">" );
1282 ptr += pointArray_toGML3(((LWLINE*)subgeom)->points, ptr, precision, opts);
1283 ptr += sprintf( ptr, "</%sposList>", prefix );
1284 ptr += sprintf( ptr, "</%sLinearRing>", prefix );
1285 }
1286 else if( subgeom->type == CIRCSTRINGTYPE )
1287 {
1288 ptr += sprintf( ptr, "<%sRing>", prefix );
1289 ptr += sprintf( ptr, "<%scurveMember>", prefix );
1290 ptr += asgml3_circstring_buf( (LWCIRCSTRING*)subgeom, srs, ptr, precision, opts, prefix, id );
1291 ptr += sprintf( ptr, "</%scurveMember>", prefix );
1292 ptr += sprintf( ptr, "</%sRing>", prefix );
1293 }
1294 else if( subgeom->type == COMPOUNDTYPE )
1295 {
1296 ptr += sprintf( ptr, "<%sRing>", prefix );
1297 ptr += sprintf( ptr, "<%scurveMember>", prefix );
1298 ptr += asgml3_compound_buf( (LWCOMPOUND*)subgeom, srs, ptr, precision, opts, prefix, id );
1299 ptr += sprintf( ptr, "</%scurveMember>", prefix );
1300 ptr += sprintf( ptr, "</%sRing>", prefix );
1301 }
1302
1303 if( i == 0 )
1304 {
1305 ptr += sprintf( ptr, "</%sexterior>", prefix);
1306 }
1307 else
1308 {
1309 ptr += sprintf( ptr, "</%sinterior>", prefix);
1310 }
1311 }
1312
1313 ptr += sprintf( ptr, "</%sPolygon>", prefix );
1314 return (ptr - output);
1315}
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 FLAGS_GET_Z(flags)
Definition liblwgeom.h:179
#define CIRCSTRINGTYPE
Definition liblwgeom.h:123
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition lwout_gml.c:1889
static size_t asgml3_circstring_buf(const LWCIRCSTRING *circ, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
Definition lwout_gml.c:942
static size_t asgml3_compound_buf(const LWCOMPOUND *col, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
Definition lwout_gml.c:1118
LWGEOM ** rings
Definition liblwgeom.h:589
lwflags_t flags
Definition liblwgeom.h:591
uint32_t nrings
Definition liblwgeom.h:594
uint8_t type
Definition liblwgeom.h:448

References asgml3_circstring_buf(), asgml3_compound_buf(), CIRCSTRINGTYPE, COMPOUNDTYPE, LWCURVEPOLY::flags, FLAGS_GET_Z, IS_DIMS, LINETYPE, LWCURVEPOLY::nrings, pointArray_toGML3(), precision, LWCURVEPOLY::rings, and LWGEOM::type.

Referenced by asgml3_curvepoly(), and asgml3_multisurface_buf().

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