PostGIS  2.5.7dev-r@@SVN_REVISION@@
effectivearea.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 2014 Nicklas Avén
22  *
23  **********************************************************************/
24 
25  #ifndef _EFFECTIVEAREA_H
26 #define _EFFECTIVEAREA_H 1
27 
28 
29  #include "liblwgeom_internal.h"
30  #include "lwgeom_log.h"
31 
32 
38 typedef struct
39 {
40  double area;
41  int treeindex;
42  int prev;
43  int next;
44 } areanode;
45 
46 
52 typedef struct
53 {
54  int maxSize;
55  int usedSize;
57 } MINHEAP;
58 
59 
64 typedef struct
65 {
66  const POINTARRAY *inpts;
68  double *res_arealist;
70 
71 
73 
75 
76 void ptarray_calc_areas(EFFECTIVE_AREAS *ea,int avoid_collaps, int set_area, double trshld);
77 
78 #endif /* _EFFECTIVEAREA_H */
EFFECTIVE_AREAS * initiate_effectivearea(const POINTARRAY *inpts)
Definition: effectivearea.c:30
void destroy_effectivearea(EFFECTIVE_AREAS *ea)
Definition: effectivearea.c:42
void ptarray_calc_areas(EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, double trshld)
We calculate the effective area for the first time.
areanode * initial_arealist
Definition: effectivearea.h:67
double * res_arealist
Definition: effectivearea.h:68
const POINTARRAY * inpts
Definition: effectivearea.h:66
Structure to hold pointarray and its arealist.
Definition: effectivearea.h:65
int maxSize
Definition: effectivearea.h:54
areanode ** key_array
Definition: effectivearea.h:56
int usedSize
Definition: effectivearea.h:55
This structure holds a minheap tree that is used to keep track of what points that has the smallest e...
Definition: effectivearea.h:53
int treeindex
Definition: effectivearea.h:41
double area
Definition: effectivearea.h:40
This structure is placed in an array with one member per point.
Definition: effectivearea.h:39