PostGIS  2.2.7dev-r@@SVN_REVISION@@
CIRC_NODE* lwgeom_calculate_circ_tree ( const LWGEOM lwgeom)

Definition at line 900 of file lwgeodetic_tree.c.

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, and LWGEOM::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().

901 {
902  if ( lwgeom_is_empty(lwgeom) )
903  return NULL;
904 
905  switch ( lwgeom->type )
906  {
907  case POINTTYPE:
908  return lwpoint_calculate_circ_tree((LWPOINT*)lwgeom);
909  case LINETYPE:
910  return lwline_calculate_circ_tree((LWLINE*)lwgeom);
911  case POLYGONTYPE:
912  return lwpoly_calculate_circ_tree((LWPOLY*)lwgeom);
913  case MULTIPOINTTYPE:
914  case MULTILINETYPE:
915  case MULTIPOLYGONTYPE:
916  case COLLECTIONTYPE:
918  default:
919  lwerror("Unable to calculate spherical index tree for type %s", lwtype_name(lwgeom->type));
920  return NULL;
921  }
922 
923 }
#define LINETYPE
Definition: liblwgeom.h:71
static CIRC_NODE * lwpoint_calculate_circ_tree(const LWPOINT *lwpoint)
#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
static CIRC_NODE * lwline_calculate_circ_tree(const LWLINE *lwline)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
uint8_t type
Definition: liblwgeom.h:380
static CIRC_NODE * lwpoly_calculate_circ_tree(const LWPOLY *lwpoly)
static CIRC_NODE * lwcollection_calculate_circ_tree(const LWCOLLECTION *lwcol)
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
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
#define COLLECTIONTYPE
Definition: liblwgeom.h:76

Here is the call graph for this function:

Here is the caller graph for this function: