PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ 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 1239 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().

1240 {
1241  uint32_t i;
1242  LWGEOM* subgeom;
1243  char *ptr=output;
1244  int dimension=2;
1245 
1246  if (FLAGS_GET_Z(poly->flags))
1247  {
1248  dimension = 3;
1249  }
1250 
1251  ptr += sprintf( ptr, "<%sPolygon", prefix );
1252  if (srs)
1253  {
1254  ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1255  }
1256  if (id)
1257  {
1258  ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1259  }
1260  ptr += sprintf(ptr, ">");
1261 
1262  for( i = 0; i < poly->nrings; ++i )
1263  {
1264  if( i == 0 )
1265  {
1266  ptr += sprintf( ptr, "<%sexterior>", prefix);
1267  }
1268  else
1269  {
1270  ptr += sprintf( ptr, "<%sinterior>", prefix);
1271  }
1272 
1273  subgeom = poly->rings[i];
1274  if ( subgeom->type == LINETYPE )
1275  {
1276  ptr += sprintf( ptr, "<%sLinearRing>", prefix );
1277  ptr += sprintf( ptr, "<%sposList", prefix );
1278  if (IS_DIMS(opts))
1279  {
1280  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1281  }
1282  ptr += sprintf( ptr, ">" );
1283  ptr += pointArray_toGML3(((LWLINE*)subgeom)->points, ptr, precision, opts);
1284  ptr += sprintf( ptr, "</%sposList>", prefix );
1285  ptr += sprintf( ptr, "</%sLinearRing>", prefix );
1286  }
1287  else if( subgeom->type == CIRCSTRINGTYPE )
1288  {
1289  ptr += sprintf( ptr, "<%sRing>", prefix );
1290  ptr += sprintf( ptr, "<%scurveMember>", prefix );
1291  ptr += asgml3_circstring_buf( (LWCIRCSTRING*)subgeom, srs, ptr, precision, opts, prefix, id );
1292  ptr += sprintf( ptr, "</%scurveMember>", prefix );
1293  ptr += sprintf( ptr, "</%sRing>", prefix );
1294  }
1295  else if( subgeom->type == COMPOUNDTYPE )
1296  {
1297  ptr += sprintf( ptr, "<%sRing>", prefix );
1298  ptr += sprintf( ptr, "<%scurveMember>", prefix );
1299  ptr += asgml3_compound_buf( (LWCOMPOUND*)subgeom, srs, ptr, precision, opts, prefix, id );
1300  ptr += sprintf( ptr, "</%scurveMember>", prefix );
1301  ptr += sprintf( ptr, "</%sRing>", prefix );
1302  }
1303 
1304  if( i == 0 )
1305  {
1306  ptr += sprintf( ptr, "</%sexterior>", prefix);
1307  }
1308  else
1309  {
1310  ptr += sprintf( ptr, "</%sinterior>", prefix);
1311  }
1312  }
1313 
1314  ptr += sprintf( ptr, "</%sPolygon>", prefix );
1315  return (ptr - output);
1316 }
#define LINETYPE
Definition: liblwgeom.h:85
LWGEOM ** rings
Definition: liblwgeom.h:537
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
unsigned int uint32_t
Definition: uthash.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:1119
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:943
#define IS_DIMS(x)
Definition: liblwgeom.h:1512
uint8_t precision
Definition: cu_in_twkb.c:25
uint8_t flags
Definition: liblwgeom.h:532
#define FLAGS_GET_Z(flags)
Macros for manipulating the &#39;flags&#39; byte.
Definition: liblwgeom.h:139
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1890
uint8_t type
Definition: liblwgeom.h:398
uint32_t nrings
Definition: liblwgeom.h:535
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: