PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ geography_valid_type()

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 70 of file geography_inout.c.

71 {
72  if ( ! (
73  type == POINTTYPE ||
74  type == LINETYPE ||
75  type == POLYGONTYPE ||
76  type == MULTIPOINTTYPE ||
77  type == MULTILINETYPE ||
80  ) )
81  {
82  ereport(ERROR, (
83  errcode(ERRCODE_INVALID_PARAMETER_VALUE),
84  errmsg("Geography type does not support %s", lwtype_name(type) )));
85 
86  }
87 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
type
Definition: ovdump.py:41

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

Referenced by geography_from_geometry(), and gserialized_geography_from_lwgeom().

Here is the call graph for this function:
Here is the caller graph for this function: