PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ circ_tree_print()

void circ_tree_print ( const CIRC_NODE node,
int  depth 
)

Definition at line 841 of file lwgeodetic_tree.c.

References circ_node::center, circ_node_is_leaf(), circ_tree_print(), circ_node::edge_num, circ_node::geom_type, GEOGRAPHIC_POINT::lat, GEOGRAPHIC_POINT::lon, lwtype_name(), circ_node::nodes, circ_node::num_nodes, circ_node::p1, circ_node::p2, POLYGONTYPE, circ_node::pt_outside, circ_node::radius, POINT2D::x, and POINT2D::y.

Referenced by circ_tree_print().

842 {
843  uint32_t i;
844 
845  if (circ_node_is_leaf(node))
846  {
847  printf("%*s[%d] C(%.5g %.5g) R(%.5g) ((%.5g %.5g),(%.5g,%.5g))",
848  3*depth + 6, "NODE", node->edge_num,
849  node->center.lon, node->center.lat,
850  node->radius,
851  node->p1->x, node->p1->y,
852  node->p2->x, node->p2->y
853  );
854  if ( node->geom_type )
855  {
856  printf(" %s", lwtype_name(node->geom_type));
857  }
858  if ( node->geom_type == POLYGONTYPE )
859  {
860  printf(" O(%.5g %.5g)", node->pt_outside.x, node->pt_outside.y);
861  }
862  printf("\n");
863 
864  }
865  else
866  {
867  printf("%*s C(%.5g %.5g) R(%.5g)",
868  3*depth + 6, "NODE",
869  node->center.lon, node->center.lat,
870  node->radius
871  );
872  if ( node->geom_type )
873  {
874  printf(" %s", lwtype_name(node->geom_type));
875  }
876  if ( node->geom_type == POLYGONTYPE )
877  {
878  printf(" O(%.5g %.5g)", node->pt_outside.x, node->pt_outside.y);
879  }
880  printf("\n");
881  }
882  for ( i = 0; i < node->num_nodes; i++ )
883  {
884  circ_tree_print(node->nodes[i], depth + 1);
885  }
886  return;
887 }
GEOGRAPHIC_POINT center
uint32_t num_nodes
uint32_t geom_type
POINT2D * p2
#define POLYGONTYPE
Definition: liblwgeom.h:86
POINT2D * p1
unsigned int uint32_t
Definition: uthash.h:78
double x
Definition: liblwgeom.h:330
static int circ_node_is_leaf(const CIRC_NODE *node)
Internal nodes have their point references set to NULL.
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
void circ_tree_print(const CIRC_NODE *node, int depth)
double y
Definition: liblwgeom.h:330
POINT2D pt_outside
double radius
struct circ_node ** nodes
Here is the call graph for this function:
Here is the caller graph for this function: