PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asgml2_line_buf ( const LWLINE line,
const char *  srs,
char *  output,
int  precision,
const char *  prefix 
)
static

Definition at line 306 of file lwout_gml.c.

References lwline_is_empty(), pointArray_toGML2(), and LWLINE::points.

Referenced by asgml2_collection_buf(), asgml2_line(), and asgml2_multi_buf().

308 {
309  char *ptr=output;
310 
311  ptr += sprintf(ptr, "<%sLineString", prefix);
312  if ( srs ) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
313 
314  if ( lwline_is_empty(line) ) {
315  ptr += sprintf(ptr, "/>");
316  return (ptr-output);
317  }
318  ptr += sprintf(ptr, ">");
319 
320  ptr += sprintf(ptr, "<%scoordinates>", prefix);
321  ptr += pointArray_toGML2(line->points, ptr, precision);
322  ptr += sprintf(ptr, "</%scoordinates></%sLineString>", prefix, prefix);
323 
324  return (ptr-output);
325 }
int lwline_is_empty(const LWLINE *line)
Definition: lwline.c:464
static size_t pointArray_toGML2(POINTARRAY *pa, char *buf, int precision)
Definition: lwout_gml.c:637
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: