PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ asgml3_triangle_buf()

static size_t asgml3_triangle_buf ( const LWTRIANGLE triangle,
const char *  srs,
char *  output,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1367 of file lwout_gml.c.

References LWTRIANGLE::flags, FLAGS_GET_Z, IS_DIMS, pointArray_toGML3(), and LWTRIANGLE::points.

Referenced by asgml3_tin_buf(), and asgml3_triangle().

1368 {
1369  char *ptr=output;
1370  int dimension=2;
1371 
1372  if (FLAGS_GET_Z(triangle->flags)) dimension = 3;
1373  ptr += sprintf(ptr, "<%sTriangle", prefix);
1374  if (srs) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1375  if (id) ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id);
1376  ptr += sprintf(ptr, ">");
1377 
1378  ptr += sprintf(ptr, "<%sexterior><%sLinearRing>", prefix, prefix);
1379  if (IS_DIMS(opts)) ptr += sprintf(ptr, "<%sposList srsDimension=\"%d\">", prefix, dimension);
1380  else ptr += sprintf(ptr, "<%sposList>", prefix);
1381 
1382  ptr += pointArray_toGML3(triangle->points, ptr, precision, opts);
1383  ptr += sprintf(ptr, "</%sposList></%sLinearRing></%sexterior>",
1384  prefix, prefix, prefix);
1385 
1386  ptr += sprintf(ptr, "</%sTriangle>", prefix);
1387 
1388  return (ptr-output);
1389 }
POINTARRAY * points
Definition: liblwgeom.h:433
#define IS_DIMS(x)
Definition: liblwgeom.h:1544
uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the &#39;flags&#39; byte.
Definition: liblwgeom.h:140
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1909
opts
Definition: ovdump.py:44
uint8_t flags
Definition: liblwgeom.h:430
Here is the call graph for this function:
Here is the caller graph for this function: