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

◆ lwgeom_calculate_circ_tree()

CIRC_NODE * lwgeom_calculate_circ_tree ( const LWGEOM lwgeom)

Definition at line 1004 of file lwgeodetic_tree.c.

1005{
1006 if ( lwgeom_is_empty(lwgeom) )
1007 return NULL;
1008
1009 switch ( lwgeom->type )
1010 {
1011 case POINTTYPE:
1012 return lwpoint_calculate_circ_tree((LWPOINT*)lwgeom);
1013 case LINETYPE:
1014 return lwline_calculate_circ_tree((LWLINE*)lwgeom);
1015 case POLYGONTYPE:
1016 return lwpoly_calculate_circ_tree((LWPOLY*)lwgeom);
1017 case MULTIPOINTTYPE:
1018 case MULTILINETYPE:
1019 case MULTIPOLYGONTYPE:
1020 case COLLECTIONTYPE:
1022 default:
1023 lwerror("Unable to calculate spherical index tree for type %s", lwtype_name(lwgeom->type));
1024 return NULL;
1025 }
1026
1027}
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:108
#define MULTILINETYPE
Definition liblwgeom.h:106
#define LINETYPE
Definition liblwgeom.h:103
#define MULTIPOINTTYPE
Definition liblwgeom.h:105
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition liblwgeom.h:102
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:107
#define POLYGONTYPE
Definition liblwgeom.h:104
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 void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
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:199
uint8_t type
Definition liblwgeom.h:462

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_closestpoint(), geography_tree_distance(), geography_tree_shortestline(), 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: