PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 122 of file lwgeodetic_tree.c.

123{
124 CIRC_NODE* tree = lwalloc(sizeof(CIRC_NODE));
125 tree->p1 = tree->p2 = (POINT2D*)getPoint_internal(pa, 0);
126 geographic_point_init(tree->p1->x, tree->p1->y, &(tree->center));
127 tree->radius = 0.0;
128 tree->nodes = NULL;
129 tree->num_nodes = 0;
130 tree->edge_num = 0;
131 tree->geom_type = POINTTYPE;
132 tree->pt_outside.x = 0.0;
133 tree->pt_outside.y = 0.0;
134 return tree;
135}
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition liblwgeom.h:102
void * lwalloc(size_t size)
Definition lwutil.c:227
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
Definition lwgeodetic.c:180
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition lwinline.h:75
double y
Definition liblwgeom.h:390
double x
Definition liblwgeom.h:390
uint32_t num_nodes
POINT2D * p2
struct circ_node ** nodes
POINT2D * p1
POINT2D pt_outside
GEOGRAPHIC_POINT center
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: