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

◆ rect_tree_from_lwgeom()

RECT_NODE * rect_tree_from_lwgeom ( const LWGEOM geom)

Create a tree index on top an LWGEOM.

Do not free the LWGEOM until the tree is freed.

Definition at line 861 of file lwtree.c.

862{
863 switch(lwgeom->type)
864 {
865 case POINTTYPE:
866 return rect_tree_from_lwpoint(lwgeom);
867 case TRIANGLETYPE:
868 case CIRCSTRINGTYPE:
869 case LINETYPE:
870 return rect_tree_from_lwline(lwgeom);
871 case POLYGONTYPE:
872 return rect_tree_from_lwpoly(lwgeom);
873 case CURVEPOLYTYPE:
874 return rect_tree_from_lwcurvepoly(lwgeom);
875 case COMPOUNDTYPE:
876 case MULTICURVETYPE:
877 case MULTISURFACETYPE:
878 case MULTIPOINTTYPE:
879 case MULTILINETYPE:
880 case MULTIPOLYGONTYPE:
882 case TINTYPE:
883 case COLLECTIONTYPE:
884 return rect_tree_from_lwcollection(lwgeom);
885 default:
886 lwerror("%s: Unknown geometry type: %s", __func__, lwtype_name(lwgeom->type));
887 return NULL;
888 }
889 return NULL;
890}
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 COMPOUNDTYPE
Definition liblwgeom.h:110
#define CURVEPOLYTYPE
Definition liblwgeom.h:111
#define MULTILINETYPE
Definition liblwgeom.h:106
#define MULTISURFACETYPE
Definition liblwgeom.h:113
#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 TINTYPE
Definition liblwgeom.h:116
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:107
#define POLYGONTYPE
Definition liblwgeom.h:104
#define POLYHEDRALSURFACETYPE
Definition liblwgeom.h:114
#define CIRCSTRINGTYPE
Definition liblwgeom.h:109
#define MULTICURVETYPE
Definition liblwgeom.h:112
#define TRIANGLETYPE
Definition liblwgeom.h:115
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static RECT_NODE * rect_tree_from_lwpoint(const LWGEOM *lwgeom)
Definition lwtree.c:731
static RECT_NODE * rect_tree_from_lwcollection(const LWGEOM *lwgeom)
Definition lwtree.c:818
static RECT_NODE * rect_tree_from_lwcurvepoly(const LWGEOM *lwgeom)
Definition lwtree.c:772
static RECT_NODE * rect_tree_from_lwpoly(const LWGEOM *lwgeom)
Definition lwtree.c:745
static RECT_NODE * rect_tree_from_lwline(const LWGEOM *lwgeom)
Definition lwtree.c:738

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LINETYPE, lwerror(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, rect_tree_from_lwcollection(), rect_tree_from_lwcurvepoly(), rect_tree_from_lwline(), rect_tree_from_lwpoint(), rect_tree_from_lwpoly(), TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by rect_tree_from_lwcollection(), rect_tree_from_lwcurvepoly(), RectTreeBuilder(), ST_DistanceRectTree(), ST_DistanceRectTreeCached(), test_rect_tree_contains_point(), test_rect_tree_distance_tree_case(), and tree_inter().

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