Create a new leaf node, storing pointers back to the end points for later.
Definition at line 69 of file lwgeodetic_tree.c.
82 LWDEBUGF(3,
"edge #%d (%g %g, %g %g)", i, p1->
x, p1->
y, p2->
x, p2->
y);
102 node->
radius = diameter / 2.0;
uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
void * lwalloc(size_t size)
void normalize(POINT3D *p)
Normalize to a unit vector.
void cart2geog(const POINT3D *p, GEOGRAPHIC_POINT *g)
Convert cartesian coordinates on unit sphere to spherical coordinates.
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e)
Given two points on a unit sphere, calculate their distance apart in radians.
void vector_sum(const POINT3D *a, const POINT3D *b, POINT3D *n)
Calculate the sum of two vectors.
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
#define LWDEBUGF(level, msg,...)
Point in spherical coordinates on the world.
struct circ_node ** nodes
Note that p1 and p2 are pointers into an independent POINTARRAY, do not free them.
References cart2geog(), circ_node::center, circ_node::edge_num, FP_EQUALS, geog2cart(), geographic_point_init(), circ_node::geom_type, getPoint_internal(), GEOGRAPHIC_POINT::lat, GEOGRAPHIC_POINT::lon, lwalloc(), LWDEBUGF, circ_node::nodes, normalize(), circ_node::num_nodes, circ_node::p1, circ_node::p2, circ_node::pt_outside, circ_node::radius, sphere_distance(), vector_sum(), POINT2D::x, and POINT2D::y.
Referenced by circ_tree_new().