Commit 01e4a171 authored by Paul Ramsey's avatar Paul Ramsey

astyle --style=ansi --indent=tab=8


git-svn-id: http://svn.osgeo.org/postgis/trunk@3284 b70326c6-7e19-0410-871a-916f4a2858ee
parent ac378e71
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* This is free software; you can redistribute and/or modify it under * This is free software; you can redistribute and/or modify it under
* the terms of the GNU General Public Licence. See the COPYING file. * the terms of the GNU General Public Licence. See the COPYING file.
* *
**********************************************************************/ **********************************************************************/
#include "../postgis_config.h" #include "../postgis_config.h"
...@@ -34,34 +34,35 @@ ...@@ -34,34 +34,35 @@
** GEOS prepared geometry is only available from GEOS 3.1 onwards ** GEOS prepared geometry is only available from GEOS 3.1 onwards
*/ */
#if POSTGIS_GEOS_VERSION >= 31 #if POSTGIS_GEOS_VERSION >= 31
#define PREPARED_GEOM #define PREPARED_GEOM
#endif #endif
/* /*
** Cache structure. We use PG_LWGEOM as keys so no transformations ** Cache structure. We use PG_LWGEOM as keys so no transformations
** are needed before we memcmp them with other keys. We store the ** are needed before we memcmp them with other keys. We store the
** size to avoid having to calculate the size every time. ** size to avoid having to calculate the size every time.
** The argnum gives the number of function arguments we are caching. ** The argnum gives the number of function arguments we are caching.
** Intersects requires that both arguments be checked for cacheability, ** Intersects requires that both arguments be checked for cacheability,
** while Contains only requires that the containing argument be checked. ** while Contains only requires that the containing argument be checked.
** Both the Geometry and the PreparedGeometry have to be cached, ** Both the Geometry and the PreparedGeometry have to be cached,
** because the PreparedGeometry contains a reference to the geometry. ** because the PreparedGeometry contains a reference to the geometry.
*/ */
#ifdef PREPARED_GEOM #ifdef PREPARED_GEOM
typedef struct typedef struct
{ {
char type; char type;
PG_LWGEOM* pg_geom1; PG_LWGEOM *pg_geom1;
PG_LWGEOM* pg_geom2; PG_LWGEOM *pg_geom2;
size_t pg_geom1_size; size_t pg_geom1_size;
size_t pg_geom2_size; size_t pg_geom2_size;
int32 argnum; int32 argnum;
const GEOSPreparedGeometry* prepared_geom; const GEOSPreparedGeometry *prepared_geom;
GEOSGeometry* geom; GEOSGeometry *geom;
MemoryContext context; MemoryContext context;
} PrepGeomCache; }
PrepGeomCache;
/* /*
** Get the current cache, given the input geometries. ** Get the current cache, given the input geometries.
** Function will create cache if none exists, and prepare geometries in ** Function will create cache if none exists, and prepare geometries in
** cache if necessary, or pull an existing cache if possible. ** cache if necessary, or pull an existing cache if possible.
......
This diff is collapsed.
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
typedef struct typedef struct
{ {
double min; double min;
double max; double max;
} INTERVAL; }
INTERVAL;
/* Returns 1 if min < value <= max, 0 otherwise */ /* Returns 1 if min < value <= max, 0 otherwise */
uint32 isContained(INTERVAL *interval, double value); uint32 isContained(INTERVAL *interval, double value);
...@@ -15,25 +16,26 @@ INTERVAL *createInterval(double value1, double value2); ...@@ -15,25 +16,26 @@ INTERVAL *createInterval(double value1, double value2);
INTERVAL *mergeIntervals(INTERVAL *inter1, INTERVAL *inter2); INTERVAL *mergeIntervals(INTERVAL *inter1, INTERVAL *inter2);
/* /*
* The following struct and methods are used for a 1D RTree implementation, * The following struct and methods are used for a 1D RTree implementation,
* described at: * described at:
* http://lin-ear-th-inking.blogspot.com/2007/06/packed-1-dimensional-r-tree.html * http://lin-ear-th-inking.blogspot.com/2007/06/packed-1-dimensional-r-tree.html
*/ */
typedef struct rtree_node typedef struct rtree_node
{ {
INTERVAL *interval; INTERVAL *interval;
struct rtree_node *leftNode; struct rtree_node *leftNode;
struct rtree_node *rightNode; struct rtree_node *rightNode;
LWLINE* segment; LWLINE *segment;
} RTREE_NODE; }
RTREE_NODE;
/* Creates an interior node given the children. */ /* Creates an interior node given the children. */
RTREE_NODE *createInteriorNode(RTREE_NODE *left, RTREE_NODE *right); RTREE_NODE *createInteriorNode(RTREE_NODE *left, RTREE_NODE *right);
/* Creates a leaf node given the pointer to the start point of the segment. */ /* Creates a leaf node given the pointer to the start point of the segment. */
RTREE_NODE *createLeafNode(POINTARRAY *pa, int startPoint); RTREE_NODE *createLeafNode(POINTARRAY *pa, int startPoint);
/* /*
* Creates an rtree given a pointer to the point array. * Creates an rtree given a pointer to the point array.
* Must copy the point array. * Must copy the point array.
*/ */
RTREE_NODE *createTree(POINTARRAY *pointArray); RTREE_NODE *createTree(POINTARRAY *pointArray);
/* Frees the tree. */ /* Frees the tree. */
...@@ -46,13 +48,14 @@ LWMLINE *mergeMultiLines(LWMLINE *line1, LWMLINE *line2); ...@@ -46,13 +48,14 @@ LWMLINE *mergeMultiLines(LWMLINE *line1, LWMLINE *line2);
typedef struct typedef struct
{ {
char type; char type;
RTREE_NODE **ringIndices; RTREE_NODE **ringIndices;
int ringCount; int ringCount;
int polyCount; int polyCount;
uchar *poly; uchar *poly;
} RTREE_POLY_CACHE; }
RTREE_POLY_CACHE;
/* /*
* Creates a new cachable index if needed, or returns the current cache if * Creates a new cachable index if needed, or returns the current cache if
* it is applicable to the current polygon. * it is applicable to the current polygon.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment