PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ circ_node_leaf_point_new()

static CIRC_NODE* circ_node_leaf_point_new ( const POINTARRAY pa)
static

Return a point node (zero radius, referencing one point)

Definition at line 96 of file lwgeodetic_tree.c.

References circ_node::center, circ_node::edge_num, geographic_point_init(), circ_node::geom_type, getPoint_internal(), lwalloc(), circ_node::nodes, circ_node::num_nodes, circ_node::p1, circ_node::p2, POINTTYPE, circ_node::pt_outside, circ_node::radius, POINT2D::x, and POINT2D::y.

Referenced by circ_tree_new().

97 {
98  CIRC_NODE* tree = lwalloc(sizeof(CIRC_NODE));
99  tree->p1 = tree->p2 = (POINT2D*)getPoint_internal(pa, 0);
100  geographic_point_init(tree->p1->x, tree->p1->y, &(tree->center));
101  tree->radius = 0.0;
102  tree->nodes = NULL;
103  tree->num_nodes = 0;
104  tree->edge_num = 0;
105  tree->geom_type = POINTTYPE;
106  tree->pt_outside.x = 0.0;
107  tree->pt_outside.y = 0.0;
108  return tree;
109 }
Note that p1 and p2 are pointers into an independent POINTARRAY, do not free them.
GEOGRAPHIC_POINT center
POINT2D * p2
POINT2D * p1
double x
Definition: liblwgeom.h:312
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
Definition: ptarray.c:1706
double y
Definition: liblwgeom.h:312
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
Definition: lwgeodetic.c:156
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
POINT2D pt_outside
double radius
void * lwalloc(size_t size)
Definition: lwutil.c:199
struct circ_node ** nodes
Here is the call graph for this function:
Here is the caller graph for this function: