PostGIS  2.1.10dev-r@@SVN_REVISION@@
char* lwgeom_to_gml3 ( const LWGEOM geom,
const char *  srs,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)

Definition at line 711 of file lwout_gml.c.

References asgml3_collection(), asgml3_line(), asgml3_multi(), asgml3_point(), asgml3_poly(), asgml3_psurface(), asgml3_tin(), asgml3_triangle(), COLLECTIONTYPE, LINETYPE, lwerror(), lwgeom_is_empty(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by do_gml3_test(), do_gml3_test_nodims(), do_gml3_test_opts(), do_gml3_test_prefix(), do_gml3_unsupported(), geography_as_gml(), and LWGEOM_asGML().

712 {
713  int type = geom->type;
714 
715  /* Return null for empty (#1377) */
716  if ( lwgeom_is_empty(geom) )
717  return NULL;
718 
719  switch (type)
720  {
721  case POINTTYPE:
722  return asgml3_point((LWPOINT*)geom, srs, precision, opts, prefix, id);
723 
724  case LINETYPE:
725  return asgml3_line((LWLINE*)geom, srs, precision, opts, prefix, id);
726 
727  case POLYGONTYPE:
728  return asgml3_poly((LWPOLY*)geom, srs, precision, opts, 0, prefix, id);
729 
730  case TRIANGLETYPE:
731  return asgml3_triangle((LWTRIANGLE*)geom, srs, precision, opts, prefix, id);
732 
733  case MULTIPOINTTYPE:
734  case MULTILINETYPE:
735  case MULTIPOLYGONTYPE:
736  return asgml3_multi((LWCOLLECTION*)geom, srs, precision, opts, prefix, id);
737 
739  return asgml3_psurface((LWPSURFACE*)geom, srs, precision, opts, prefix, id);
740 
741  case TINTYPE:
742  return asgml3_tin((LWTIN*)geom, srs, precision, opts, prefix, id);
743 
744  case COLLECTIONTYPE:
745  return asgml3_collection((LWCOLLECTION*)geom, srs, precision, opts, prefix, id);
746 
747  default:
748  lwerror("lwgeom_to_gml3: '%s' geometry type not supported", lwtype_name(type));
749  return NULL;
750  }
751 }
#define LINETYPE
Definition: liblwgeom.h:61
static char * asgml3_triangle(const LWTRIANGLE *triangle, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1021
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
#define TRIANGLETYPE
Definition: liblwgeom.h:73
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:72
static char * asgml3_psurface(const LWPSURFACE *psur, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1202
static char * asgml3_point(const LWPOINT *point, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:793
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
static char * asgml3_poly(const LWPOLY *poly, const char *srs, int precision, int opts, int is_patch, const char *prefix, const char *id)
Definition: lwout_gml.c:966
#define TINTYPE
Definition: liblwgeom.h:74
static char * asgml3_multi(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1137
static char * asgml3_line(const LWLINE *line, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:884
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
static char * asgml3_collection(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1377
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
uint8_t type
Definition: liblwgeom.h:352
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
#define MULTILINETYPE
Definition: liblwgeom.h:64
static char * asgml3_tin(const LWTIN *tin, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1267
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: