PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwgeom_calculate_circ_tree()

CIRC_NODE * lwgeom_calculate_circ_tree ( const LWGEOM lwgeom)

Definition at line 1005 of file lwgeodetic_tree.c.

1006{
1007 if ( lwgeom_is_empty(lwgeom) )
1008 return NULL;
1009
1010 switch ( lwgeom->type )
1011 {
1012 case POINTTYPE:
1013 return lwpoint_calculate_circ_tree((LWPOINT*)lwgeom);
1014 case LINETYPE:
1015 return lwline_calculate_circ_tree((LWLINE*)lwgeom);
1016 case POLYGONTYPE:
1017 return lwpoly_calculate_circ_tree((LWPOLY*)lwgeom);
1018 case MULTIPOINTTYPE:
1019 case MULTILINETYPE:
1020 case MULTIPOLYGONTYPE:
1021 case COLLECTIONTYPE:
1023 default:
1024 lwerror("Unable to calculate spherical index tree for type %s", lwtype_name(lwgeom->type));
1025 return NULL;
1026 }
1027
1028}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition lwutil.c:216
#define COLLECTIONTYPE
Definition liblwgeom.h:122
#define MULTILINETYPE
Definition liblwgeom.h:120
#define LINETYPE
Definition liblwgeom.h:117
#define MULTIPOINTTYPE
Definition liblwgeom.h:119
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition liblwgeom.h:116
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:121
#define POLYGONTYPE
Definition liblwgeom.h:118
static CIRC_NODE * lwcollection_calculate_circ_tree(const LWCOLLECTION *lwcol)
static CIRC_NODE * lwpoly_calculate_circ_tree(const LWPOLY *lwpoly)
static CIRC_NODE * lwline_calculate_circ_tree(const LWLINE *lwline)
static CIRC_NODE * lwpoint_calculate_circ_tree(const LWPOINT *lwpoint)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition lwutil.c:190
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition lwinline.h:193
uint8_t type
Definition liblwgeom.h:448

References COLLECTIONTYPE, sort_node::d, 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, and POLYGONTYPE.

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: