PostGIS  3.1.6dev-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 1250 of file lwout_gml.c.

1251 {
1252  uint32_t i;
1253  LWGEOM* subgeom;
1254  char *ptr=output;
1255  int dimension=2;
1256 
1257  if (FLAGS_GET_Z(poly->flags))
1258  {
1259  dimension = 3;
1260  }
1261 
1262  ptr += sprintf( ptr, "<%sPolygon", prefix );
1263  if (srs)
1264  {
1265  ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1266  }
1267  if (id)
1268  {
1269  ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1270  }
1271  ptr += sprintf(ptr, ">");
1272 
1273  for( i = 0; i < poly->nrings; ++i )
1274  {
1275  if( i == 0 )
1276  {
1277  ptr += sprintf( ptr, "<%sexterior>", prefix);
1278  }
1279  else
1280  {
1281  ptr += sprintf( ptr, "<%sinterior>", prefix);
1282  }
1283 
1284  subgeom = poly->rings[i];
1285  if ( subgeom->type == LINETYPE )
1286  {
1287  ptr += sprintf( ptr, "<%sLinearRing>", prefix );
1288  ptr += sprintf( ptr, "<%sposList", prefix );
1289  if (IS_DIMS(opts))
1290  {
1291  ptr += sprintf(ptr, " srsDimension=\"%d\"", dimension);
1292  }
1293  ptr += sprintf( ptr, ">" );
1294  ptr += pointArray_toGML3(((LWLINE*)subgeom)->points, ptr, precision, opts);
1295  ptr += sprintf( ptr, "</%sposList>", prefix );
1296  ptr += sprintf( ptr, "</%sLinearRing>", prefix );
1297  }
1298  else if( subgeom->type == CIRCSTRINGTYPE )
1299  {
1300  ptr += sprintf( ptr, "<%sRing>", prefix );
1301  ptr += sprintf( ptr, "<%scurveMember>", prefix );
1302  ptr += asgml3_circstring_buf( (LWCIRCSTRING*)subgeom, srs, ptr, precision, opts, prefix, id );
1303  ptr += sprintf( ptr, "</%scurveMember>", prefix );
1304  ptr += sprintf( ptr, "</%sRing>", prefix );
1305  }
1306  else if( subgeom->type == COMPOUNDTYPE )
1307  {
1308  ptr += sprintf( ptr, "<%sRing>", prefix );
1309  ptr += sprintf( ptr, "<%scurveMember>", prefix );
1310  ptr += asgml3_compound_buf( (LWCOMPOUND*)subgeom, srs, ptr, precision, opts, prefix, id );
1311  ptr += sprintf( ptr, "</%scurveMember>", prefix );
1312  ptr += sprintf( ptr, "</%sRing>", prefix );
1313  }
1314 
1315  if( i == 0 )
1316  {
1317  ptr += sprintf( ptr, "</%sexterior>", prefix);
1318  }
1319  else
1320  {
1321  ptr += sprintf( ptr, "</%sinterior>", prefix);
1322  }
1323  }
1324 
1325  ptr += sprintf( ptr, "</%sPolygon>", prefix );
1326  return (ptr - output);
1327 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define COMPOUNDTYPE
Definition: liblwgeom.h:124
#define IS_DIMS(x)
Definition: liblwgeom.h:1682
#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:1897
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
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:1132
opts
Definition: ovdump.py:45
LWGEOM ** rings
Definition: liblwgeom.h:617
lwflags_t flags
Definition: liblwgeom.h:619
uint32_t nrings
Definition: liblwgeom.h:622
uint8_t type
Definition: liblwgeom.h:476

References asgml3_circstring_buf(), asgml3_compound_buf(), CIRCSTRINGTYPE, COMPOUNDTYPE, LWCURVEPOLY::flags, FLAGS_GET_Z, IS_DIMS, LINETYPE, LWCURVEPOLY::nrings, ovdump::opts, 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: