PostGIS  2.1.10dev-r@@SVN_REVISION@@
char* lwgeom_to_kml2 ( const LWGEOM geom,
int  precision,
const char *  prefix 
)

Definition at line 32 of file lwout_kml.c.

References LW_FAILURE, lwgeom_is_empty(), lwgeom_to_kml2_sb(), stringbuffer_create(), stringbuffer_destroy(), and stringbuffer_getstringcopy().

Referenced by do_kml_test(), do_kml_test_prefix(), do_kml_unsupported(), geography_as_kml(), and LWGEOM_asKML().

33 {
34  stringbuffer_t *sb;
35  int rv;
36  char *kml;
37 
38  /* Can't do anything with empty */
39  if( lwgeom_is_empty(geom) )
40  return NULL;
41 
42  sb = stringbuffer_create();
43  rv = lwgeom_to_kml2_sb(geom, precision, prefix, sb);
44 
45  if ( rv == LW_FAILURE )
46  {
48  return NULL;
49  }
50 
53 
54  return kml;
55 }
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
Definition: stringbuffer.c:47
char * stringbuffer_getstringcopy(stringbuffer_t *s)
Returns a newly allocated string large enough to contain the current state of the string...
Definition: stringbuffer.c:154
#define LW_FAILURE
Definition: liblwgeom.h:54
static int lwgeom_to_kml2_sb(const LWGEOM *geom, int precision, const char *prefix, stringbuffer_t *sb)
Definition: lwout_kml.c:58
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.
Definition: stringbuffer.c:72
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1229

Here is the call graph for this function:

Here is the caller graph for this function: