PostGIS  2.2.8dev-r@@SVN_REVISION@@
lwgeodetic_tree.h
Go to the documentation of this file.
1 
2 #ifndef _LWGEODETIC_TREE_H
3 #define _LWGEODETIC_TREE_H 1
4 
5 #include "lwgeodetic.h"
6 
7 #define CIRC_NODE_SIZE 8
8 
12 typedef struct circ_node
13 {
15  double radius;
16  int num_nodes;
17  struct circ_node** nodes;
18  int edge_num;
19  int geom_type;
23 } CIRC_NODE;
24 
25 void circ_tree_print(const CIRC_NODE* node, int depth);
27 void circ_tree_free(CIRC_NODE* node);
28 int circ_tree_contains_point(const CIRC_NODE* node, const POINT2D* pt, const POINT2D* pt_outside, int* on_boundary);
29 double circ_tree_distance_tree(const CIRC_NODE* n1, const CIRC_NODE* n2, const SPHEROID *spheroid, double threshold);
31 int circ_tree_get_point(const CIRC_NODE* node, POINT2D* pt);
32 
33 #endif /* _LWGEODETIC_TREE_H */
34 
35 
Note that p1 and p2 are pointers into an independent POINTARRAY, do not free them.
GEOGRAPHIC_POINT center
int circ_tree_get_point(const CIRC_NODE *node, POINT2D *pt)
Returns a POINT2D that is a vertex of the input shape.
POINT2D * p2
POINT2D * p1
double circ_tree_distance_tree(const CIRC_NODE *n1, const CIRC_NODE *n2, const SPHEROID *spheroid, double threshold)
CIRC_NODE * lwgeom_calculate_circ_tree(const LWGEOM *lwgeom)
Point in spherical coordinates on the world.
Definition: lwgeodetic.h:32
CIRC_NODE * circ_tree_new(const POINTARRAY *pa)
Build a tree of nodes from a point array, one node per edge.
int circ_tree_contains_point(const CIRC_NODE *node, const POINT2D *pt, const POINT2D *pt_outside, int *on_boundary)
Walk the tree and count intersections between the stab line and the edges.
void circ_tree_print(const CIRC_NODE *node, int depth)
struct circ_node CIRC_NODE
Note that p1 and p2 are pointers into an independent POINTARRAY, do not free them.
void circ_tree_free(CIRC_NODE *node)
Recurse from top of node tree and free all children.
POINT2D pt_outside
double radius
struct circ_node ** nodes