PostGIS  2.2.7dev-r@@SVN_REVISION@@
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 1245 of file lwout_gml.c.

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

Referenced by asgml3_curvepoly(), and asgml3_multisurface_buf().

1246 {
1247  int i;
1248  LWGEOM* subgeom;
1249  char *ptr=output;
1250  int dimension=2;
1251 
1252  if (FLAGS_GET_Z(poly->flags))
1253  {
1254  dimension = 3;
1255  }
1256 
1257  ptr += sprintf( ptr, "<%sPolygon", prefix );
1258  if (srs)
1259  {
1260  ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1261  }
1262  if (id)
1263  {
1264  ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1265  }
1266  ptr += sprintf(ptr, ">");
1267 
1268  for( i = 0; i < poly->nrings; ++i )
1269  {
1270  if( i == 0 )
1271  {
1272  ptr += sprintf( ptr, "<%sexterior>", prefix);
1273  }
1274  else
1275  {
1276  ptr += sprintf( ptr, "<%sinterior>", prefix);
1277  }
1278 
1279  subgeom = poly->rings[i];
1280  if ( subgeom->type == LINETYPE )
1281  {
1282  ptr += sprintf( ptr, "<%sLinearRing>", prefix );
1283  ptr += sprintf( ptr, "<%sposList", prefix );
1284  if (IS_DIMS(opts))
1285  {
1286  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1287  }
1288  ptr += sprintf( ptr, ">" );
1289  ptr += pointArray_toGML3(((LWLINE*)subgeom)->points, ptr, precision, opts);
1290  ptr += sprintf( ptr, "</%sposList>", prefix );
1291  ptr += sprintf( ptr, "</%sLinearRing>", prefix );
1292  }
1293  else if( subgeom->type == CIRCSTRINGTYPE )
1294  {
1295  ptr += sprintf( ptr, "<%sRing>", prefix );
1296  ptr += sprintf( ptr, "<%scurveMember>", prefix );
1297  ptr += asgml3_circstring_buf( (LWCIRCSTRING*)subgeom, srs, ptr, precision, opts, prefix, id );
1298  ptr += sprintf( ptr, "</%scurveMember>", prefix );
1299  ptr += sprintf( ptr, "</%sRing>", prefix );
1300  }
1301  else if( subgeom->type == COMPOUNDTYPE )
1302  {
1303  ptr += sprintf( ptr, "<%sRing>", prefix );
1304  ptr += sprintf( ptr, "<%scurveMember>", prefix );
1305  ptr += asgml3_compound_buf( (LWCOMPOUND*)subgeom, srs, ptr, precision, opts, prefix, id );
1306  ptr += sprintf( ptr, "</%scurveMember>", prefix );
1307  ptr += sprintf( ptr, "</%sRing>", prefix );
1308  }
1309 
1310  if( i == 0 )
1311  {
1312  ptr += sprintf( ptr, "</%sexterior>", prefix);
1313  }
1314  else
1315  {
1316  ptr += sprintf( ptr, "</%sinterior>", prefix);
1317  }
1318  }
1319 
1320  ptr += sprintf( ptr, "</%sPolygon>", prefix );
1321  return (ptr - output);
1322 }
#define LINETYPE
Definition: liblwgeom.h:71
LWGEOM ** rings
Definition: liblwgeom.h:519
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
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:1125
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:949
#define IS_DIMS(x)
Definition: liblwgeom.h:1478
uint8_t precision
Definition: cu_in_twkb.c:25
uint8_t flags
Definition: liblwgeom.h:514
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1896
uint8_t type
Definition: liblwgeom.h:380
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77

Here is the call graph for this function:

Here is the caller graph for this function: