PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ circ_node_leaf_point_new()

static CIRC_NODE* circ_node_leaf_point_new ( const POINTARRAY pa)

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

Definition at line 123 of file lwgeodetic_tree.c.

124 {
125  CIRC_NODE* tree = lwalloc(sizeof(CIRC_NODE));
126  tree->p1 = tree->p2 = (POINT2D*)getPoint_internal(pa, 0);
127  geographic_point_init(tree->p1->x, tree->p1->y, &(tree->center));
128  tree->radius = 0.0;
129  tree->nodes = NULL;
130  tree->num_nodes = 0;
131  tree->edge_num = 0;
132  tree->geom_type = POINTTYPE;
133  tree->pt_outside.x = 0.0;
134  tree->pt_outside.y = 0.0;
135  return tree;
136 }
uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition: ptarray.c:1750
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
void * lwalloc(size_t size)
Definition: lwutil.c:229
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
Definition: lwgeodetic.c:180
double y
Definition: liblwgeom.h:331
double x
Definition: liblwgeom.h:331
uint32_t num_nodes
POINT2D * p2
struct circ_node ** nodes
double radius
POINT2D * p1
POINT2D pt_outside
uint32_t geom_type
Note that p1 and p2 are pointers into an independent POINTARRAY, do not free them.

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().

Here is the call graph for this function:
Here is the caller graph for this function: