PostGIS  2.4.9dev-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 121 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().

122 {
123  CIRC_NODE* tree = lwalloc(sizeof(CIRC_NODE));
124  tree->p1 = tree->p2 = (POINT2D*)getPoint_internal(pa, 0);
125  geographic_point_init(tree->p1->x, tree->p1->y, &(tree->center));
126  tree->radius = 0.0;
127  tree->nodes = NULL;
128  tree->num_nodes = 0;
129  tree->edge_num = 0;
130  tree->geom_type = POINTTYPE;
131  tree->pt_outside.x = 0.0;
132  tree->pt_outside.y = 0.0;
133  return tree;
134 }
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:328
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
Definition: ptarray.c:1753
double y
Definition: liblwgeom.h:328
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
Definition: lwgeodetic.c:180
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
POINT2D pt_outside
double radius
void * lwalloc(size_t size)
Definition: lwutil.c:229
struct circ_node ** nodes
Here is the call graph for this function:
Here is the caller graph for this function: