PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ 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 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
#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 TINTYPE
Definition: liblwgeom.h:99
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define MULTICURVETYPE
Definition: liblwgeom.h:95
#define TRIANGLETYPE
Definition: liblwgeom.h:98
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
static RECT_NODE * rect_tree_from_lwline(const LWGEOM *lwgeom)
Definition: lwtree.c:738
static RECT_NODE * rect_tree_from_lwcurvepoly(const LWGEOM *lwgeom)
Definition: lwtree.c:772
static RECT_NODE * rect_tree_from_lwpoint(const LWGEOM *lwgeom)
Definition: lwtree.c:731
static RECT_NODE * rect_tree_from_lwpoly(const LWGEOM *lwgeom)
Definition: lwtree.c:745
static RECT_NODE * rect_tree_from_lwcollection(const LWGEOM *lwgeom)
Definition: lwtree.c:818
uint8_t type
Definition: liblwgeom.h:399

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: