PostGIS  2.1.10dev-r@@SVN_REVISION@@
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 996 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().

997 {
998  char *ptr=output;
999  int dimension=2;
1000 
1001  if (FLAGS_GET_Z(triangle->flags)) dimension = 3;
1002  ptr += sprintf(ptr, "<%sTriangle", prefix);
1003  if (srs) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1004  if (id) ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id);
1005  ptr += sprintf(ptr, ">");
1006 
1007  ptr += sprintf(ptr, "<%sexterior><%sLinearRing>", prefix, prefix);
1008  if (IS_DIMS(opts)) ptr += sprintf(ptr, "<%sposList srsDimension=\"%d\">", prefix, dimension);
1009  else ptr += sprintf(ptr, "<%sposList>", prefix);
1010 
1011  ptr += pointArray_toGML3(triangle->points, ptr, precision, opts);
1012  ptr += sprintf(ptr, "</%sposList></%sLinearRing></%sexterior>",
1013  prefix, prefix, prefix);
1014 
1015  ptr += sprintf(ptr, "</%sTriangle>", prefix);
1016 
1017  return (ptr-output);
1018 }
POINTARRAY * points
Definition: liblwgeom.h:389
#define IS_DIMS(x)
Definition: liblwgeom.h:1367
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1393
uint8_t flags
Definition: liblwgeom.h:386

Here is the call graph for this function:

Here is the caller graph for this function: