PostGIS  2.4.9dev-r@@SVN_REVISION@@
lwtree.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * PostGIS - Spatial Types for PostgreSQL
4  * http://postgis.net
5  *
6  * PostGIS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * PostGIS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with PostGIS. If not, see <http://www.gnu.org/licenses/>.
18  *
19  **********************************************************************
20  *
21  * Copyright (C) 2009-2012 Paul Ramsey <pramsey@cleverelephant.ca>
22  *
23  **********************************************************************/
24 
25 typedef struct rect_node
26 {
27  double xmin;
28  double xmax;
29  double ymin;
30  double ymax;
35 } RECT_NODE;
36 
37 int rect_tree_contains_point(const RECT_NODE *tree, const POINT2D *pt, int *on_boundary);
38 int rect_tree_intersects_tree(const RECT_NODE *tree1, const RECT_NODE *tree2);
39 void rect_tree_free(RECT_NODE *node);
40 RECT_NODE* rect_node_leaf_new(const POINTARRAY *pa, int i);
struct rect_node * right_node
Definition: lwtree.h:32
int rect_tree_intersects_tree(const RECT_NODE *tree1, const RECT_NODE *tree2)
Definition: lwtree.c:79
int rect_tree_contains_point(const RECT_NODE *tree, const POINT2D *pt, int *on_boundary)
Definition: lwtree.c:58
POINT2D * p1
Definition: lwtree.h:33
RECT_NODE * rect_tree_new(const POINTARRAY *pa)
Build a tree of nodes from a point array, one node per edge, and each with an associated measure rang...
Definition: lwtree.c:175
POINT2D * p2
Definition: lwtree.h:34
double xmax
Definition: lwtree.h:28
double ymax
Definition: lwtree.h:30
struct rect_node RECT_NODE
RECT_NODE * rect_node_leaf_new(const POINTARRAY *pa, int i)
Create a new leaf node, calculating a measure value for each point on the edge and storing pointers b...
Definition: lwtree.c:128
double xmin
Definition: lwtree.h:27
double ymin
Definition: lwtree.h:29
void rect_tree_free(RECT_NODE *node)
Recurse from top of node tree and free all children.
Definition: lwtree.c:42
RECT_NODE * rect_node_internal_new(RECT_NODE *left_node, RECT_NODE *right_node)
Create a new internal node, calculating the new measure range for the node, and storing pointers to t...
Definition: lwtree.c:156
struct rect_node * left_node
Definition: lwtree.h:31