PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_calculate_circ_tree()

CIRC_NODE* lwgeom_calculate_circ_tree ( const LWGEOM lwgeom)

Definition at line 989 of file lwgeodetic_tree.c.

990 {
991  if ( lwgeom_is_empty(lwgeom) )
992  return NULL;
993 
994  switch ( lwgeom->type )
995  {
996  case POINTTYPE:
997  return lwpoint_calculate_circ_tree((LWPOINT*)lwgeom);
998  case LINETYPE:
999  return lwline_calculate_circ_tree((LWLINE*)lwgeom);
1000  case POLYGONTYPE:
1001  return lwpoly_calculate_circ_tree((LWPOLY*)lwgeom);
1002  case MULTIPOINTTYPE:
1003  case MULTILINETYPE:
1004  case MULTIPOLYGONTYPE:
1005  case COLLECTIONTYPE:
1007  default:
1008  lwerror("Unable to calculate spherical index tree for type %s", lwtype_name(lwgeom->type));
1009  return NULL;
1010  }
1011 
1012 }
#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
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:1393
static CIRC_NODE * lwpoly_calculate_circ_tree(const LWPOLY *lwpoly)
static CIRC_NODE * lwcollection_calculate_circ_tree(const LWCOLLECTION *lwcol)
static CIRC_NODE * lwpoint_calculate_circ_tree(const LWPOINT *lwpoint)
static CIRC_NODE * lwline_calculate_circ_tree(const LWLINE *lwline)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
uint8_t type
Definition: liblwgeom.h:399

References COLLECTIONTYPE, LINETYPE, lwcollection_calculate_circ_tree(), lwerror(), lwgeom_is_empty(), lwline_calculate_circ_tree(), lwpoint_calculate_circ_tree(), lwpoly_calculate_circ_tree(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, LWGEOM::type, and LWPOINT::type.

Referenced by CircTreeBuilder(), geography_distance_cache_tolerance(), geography_tree_distance(), lwcollection_calculate_circ_tree(), test_tree_circ_distance(), and test_tree_circ_distance_threshold().

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