PostGIS  2.2.7dev-r@@SVN_REVISION@@
void geography_valid_type ( uint8_t  type)

The geography type only support POINT, LINESTRING, POLYGON, MULTI* variants of same, and GEOMETRYCOLLECTION.

If the input type is not one of those, shut down the query.

Definition at line 55 of file geography_inout.c.

References COLLECTIONTYPE, LINETYPE, lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, and POLYGONTYPE.

Referenced by geography_from_geometry(), and gserialized_geography_from_lwgeom().

56 {
57  if ( ! (
58  type == POINTTYPE ||
59  type == LINETYPE ||
60  type == POLYGONTYPE ||
61  type == MULTIPOINTTYPE ||
62  type == MULTILINETYPE ||
63  type == MULTIPOLYGONTYPE ||
64  type == COLLECTIONTYPE
65  ) )
66  {
67  ereport(ERROR, (
68  errcode(ERRCODE_INVALID_PARAMETER_VALUE),
69  errmsg("Geography type does not support %s", lwtype_name(type) )));
70 
71  }
72 }
#define LINETYPE
Definition: liblwgeom.h:71
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:188
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
#define MULTILINETYPE
Definition: liblwgeom.h:74
#define COLLECTIONTYPE
Definition: liblwgeom.h:76

Here is the call graph for this function:

Here is the caller graph for this function: