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

Definition at line 31 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().

32 {
33  stringbuffer_t *sb;
34  int rv;
35  char *kml;
36 
37  /* Can't do anything with empty */
38  if( lwgeom_is_empty(geom) )
39  return NULL;
40 
41  sb = stringbuffer_create();
42  rv = lwgeom_to_kml2_sb(geom, precision, prefix, sb);
43 
44  if ( rv == LW_FAILURE )
45  {
47  return NULL;
48  }
49 
52 
53  return kml;
54 }
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
Definition: stringbuffer.c:46
char * stringbuffer_getstringcopy(stringbuffer_t *s)
Returns a newly allocated string large enough to contain the current state of the string...
Definition: stringbuffer.c:153
#define LW_FAILURE
Definition: liblwgeom.h:64
uint8_t precision
Definition: cu_in_twkb.c:25
static int lwgeom_to_kml2_sb(const LWGEOM *geom, int precision, const char *prefix, stringbuffer_t *sb)
Definition: lwout_kml.c:57
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.
Definition: stringbuffer.c:71
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:1297

Here is the call graph for this function:

Here is the caller graph for this function: