PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_to_gml3()

char* lwgeom_to_gml3 ( const LWGEOM geom,
const char *  srs,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)

Definition at line 736 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, ovdump::type, 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().

737 {
738  int type = geom->type;
739 
740  /* Return null for empty (#1377) */
741  if ( lwgeom_is_empty(geom) )
742  return NULL;
743 
744  switch (type)
745  {
746  case POINTTYPE:
747  return asgml3_point((LWPOINT*)geom, srs, precision, opts, prefix, id);
748 
749  case LINETYPE:
750  return asgml3_line((LWLINE*)geom, srs, precision, opts, prefix, id);
751 
752  case CIRCSTRINGTYPE:
753  return asgml3_circstring((LWCIRCSTRING*)geom, srs, precision, opts, prefix, id );
754 
755  case POLYGONTYPE:
756  return asgml3_poly((LWPOLY*)geom, srs, precision, opts, 0, prefix, id);
757 
758  case CURVEPOLYTYPE:
759  return asgml3_curvepoly((LWCURVEPOLY*)geom, srs, precision, opts, prefix, id);
760 
761  case TRIANGLETYPE:
762  return asgml3_triangle((LWTRIANGLE*)geom, srs, precision, opts, prefix, id);
763 
764  case MULTIPOINTTYPE:
765  case MULTILINETYPE:
766  case MULTIPOLYGONTYPE:
767  return asgml3_multi((LWCOLLECTION*)geom, srs, precision, opts, prefix, id);
768 
770  return asgml3_psurface((LWPSURFACE*)geom, srs, precision, opts, prefix, id);
771 
772  case TINTYPE:
773  return asgml3_tin((LWTIN*)geom, srs, precision, opts, prefix, id);
774 
775  case COLLECTIONTYPE:
776  return asgml3_collection((LWCOLLECTION*)geom, srs, precision, opts, prefix, id);
777 
778  case COMPOUNDTYPE:
779  return asgml3_compound( (LWCOMPOUND*)geom, srs, precision, opts, prefix, id );
780 
781  case MULTICURVETYPE:
782  return asgml3_multicurve( (LWMCURVE*)geom, srs, precision, opts, prefix, id );
783 
784  case MULTISURFACETYPE:
785  return asgml3_multisurface( (LWMSURFACE*)geom, srs, precision, opts, prefix, id );
786 
787  default:
788  lwerror("lwgeom_to_gml3: '%s' geometry type not supported", lwtype_name(type));
789  return NULL;
790  }
791 }
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTICURVETYPE
Definition: liblwgeom.h:95
static char * asgml3_triangle(const LWTRIANGLE *triangle, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1392
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define TRIANGLETYPE
Definition: liblwgeom.h:98
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
static char * asgml3_psurface(const LWPSURFACE *psur, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1574
static char * asgml3_point(const LWPOINT *point, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:834
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
static char * asgml3_compound(const LWCOMPOUND *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1200
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:1084
#define TINTYPE
Definition: liblwgeom.h:99
static char * asgml3_multi(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1509
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:1895
static char * asgml3_multicurve(const LWMCURVE *cur, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1829
static char * asgml3_line(const LWLINE *line, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:936
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
static char * asgml3_collection(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1750
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
uint8_t type
Definition: liblwgeom.h:396
type
Definition: ovdump.py:41
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
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:1346
#define MULTILINETYPE
Definition: liblwgeom.h:89
opts
Definition: ovdump.py:44
static char * asgml3_curvepoly(const LWCURVEPOLY *poly, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1337
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
static char * asgml3_tin(const LWTIN *tin, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1639
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
static char * asgml3_circstring(const LWCIRCSTRING *circ, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1001
Here is the call graph for this function:
Here is the caller graph for this function: