PostGIS  2.2.7dev-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 723 of file lwout_gml.c.

References asgml3_circstring(), asgml3_collection(), asgml3_compound(), asgml3_curvepoly(), asgml3_line(), asgml3_multi(), asgml3_multicurve(), asgml3_multisurface(), asgml3_point(), asgml3_poly(), asgml3_psurface(), asgml3_tin(), asgml3_triangle(), CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LINETYPE, lwerror(), lwgeom_is_empty(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, 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(), geography_as_gml(), and LWGEOM_asGML().

724 {
725  int type = geom->type;
726 
727  /* Return null for empty (#1377) */
728  if ( lwgeom_is_empty(geom) )
729  return NULL;
730 
731  switch (type)
732  {
733  case POINTTYPE:
734  return asgml3_point((LWPOINT*)geom, srs, precision, opts, prefix, id);
735 
736  case LINETYPE:
737  return asgml3_line((LWLINE*)geom, srs, precision, opts, prefix, id);
738 
739  case CIRCSTRINGTYPE:
740  return asgml3_circstring((LWCIRCSTRING*)geom, srs, precision, opts, prefix, id );
741 
742  case POLYGONTYPE:
743  return asgml3_poly((LWPOLY*)geom, srs, precision, opts, 0, prefix, id);
744 
745  case CURVEPOLYTYPE:
746  return asgml3_curvepoly((LWCURVEPOLY*)geom, srs, precision, opts, prefix, id);
747 
748  case TRIANGLETYPE:
749  return asgml3_triangle((LWTRIANGLE*)geom, srs, precision, opts, prefix, id);
750 
751  case MULTIPOINTTYPE:
752  case MULTILINETYPE:
753  case MULTIPOLYGONTYPE:
754  return asgml3_multi((LWCOLLECTION*)geom, srs, precision, opts, prefix, id);
755 
757  return asgml3_psurface((LWPSURFACE*)geom, srs, precision, opts, prefix, id);
758 
759  case TINTYPE:
760  return asgml3_tin((LWTIN*)geom, srs, precision, opts, prefix, id);
761 
762  case COLLECTIONTYPE:
763  return asgml3_collection((LWCOLLECTION*)geom, srs, precision, opts, prefix, id);
764 
765  case COMPOUNDTYPE:
766  return asgml3_compound( (LWCOMPOUND*)geom, srs, precision, opts, prefix, id );
767 
768  case MULTICURVETYPE:
769  return asgml3_multicurve( (LWMCURVE*)geom, srs, precision, opts, prefix, id );
770 
771  case MULTISURFACETYPE:
772  return asgml3_multisurface( (LWMSURFACE*)geom, srs, precision, opts, prefix, id );
773 
774  default:
775  lwerror("lwgeom_to_gml3: '%s' geometry type not supported", lwtype_name(type));
776  return NULL;
777  }
778 }
#define LINETYPE
Definition: liblwgeom.h:71
#define MULTICURVETYPE
Definition: liblwgeom.h:80
static char * asgml3_triangle(const LWTRIANGLE *triangle, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1379
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define CURVEPOLYTYPE
Definition: liblwgeom.h:79
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
#define TRIANGLETYPE
Definition: liblwgeom.h:83
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:82
static char * asgml3_psurface(const LWPSURFACE *psur, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1561
static char * asgml3_point(const LWPOINT *point, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:821
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:188
static char * asgml3_compound(const LWCOMPOUND *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1187
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:1071
#define TINTYPE
Definition: liblwgeom.h:84
static char * asgml3_multi(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1496
uint8_t precision
Definition: cu_in_twkb.c:25
static char * asgml3_multisurface(const LWMSURFACE *sur, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1882
static char * asgml3_multicurve(const LWMCURVE *cur, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1816
static char * asgml3_line(const LWLINE *line, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:923
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
static char * asgml3_collection(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1737
#define MULTISURFACETYPE
Definition: liblwgeom.h:81
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
uint8_t type
Definition: liblwgeom.h:380
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77
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
#define MULTILINETYPE
Definition: liblwgeom.h:74
static char * asgml3_curvepoly(const LWCURVEPOLY *poly, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1324
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
static char * asgml3_tin(const LWTIN *tin, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1626
#define COLLECTIONTYPE
Definition: liblwgeom.h:76
static char * asgml3_circstring(const LWCIRCSTRING *circ, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:988

Here is the call graph for this function:

Here is the caller graph for this function: