|  |  |  | GTS Library Reference Manual |  | 
|---|
#include <gts.h>GNode * gts_kdtree_new (GPtrArray *points, int (*compare) (const void *,const void *));GSList * gts_kdtree_range (GNode *tree, GtsBBox *bbox, int (*compare) (const void *,const void *)); #define gts_kdtree_destroy (tree)
Kd-Trees (in this case 3D-Trees) are a relatively efficient way of doing point location queries.
GNode * gts_kdtree_new (GPtrArray *points, int (*compare) (const void *,const void *));
Note that the order of the points in array points is modified by this function.
| points : | an array of GtsPoint. | 
| compare : | always NULL. | 
| Returns : | a new 3D tree for points. | 
GSList * gts_kdtree_range (GNode *tree, GtsBBox *bbox, int (*compare) (const void *,const void *));
| tree : | a 3D tree. | 
| bbox : | a GtsBBox. | 
| compare : | always NULL. | 
| Returns : | a list of GtsPoint belonging to tree which are inside bbox. | 
| <<< Geometrical data structures | Bounding boxes trees >>> |