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 @@
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU General Public Licence. See the COPYING file.
*
*
**********************************************************************/
#include "../postgis_config.h"
......@@ -34,34 +34,35 @@
** GEOS prepared geometry is only available from GEOS 3.1 onwards
*/
#if POSTGIS_GEOS_VERSION >= 31
#define PREPARED_GEOM
#define PREPARED_GEOM
#endif
/*
/*
** 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.
** The argnum gives the number of function arguments we are caching.
** Intersects requires that both arguments be checked for cacheability,
** while Contains only requires that the containing argument be checked.
** Both the Geometry and the PreparedGeometry have to be cached,
** The argnum gives the number of function arguments we are caching.
** Intersects requires that both arguments be checked for cacheability,
** while Contains only requires that the containing argument be checked.
** Both the Geometry and the PreparedGeometry have to be cached,
** because the PreparedGeometry contains a reference to the geometry.
*/
#ifdef PREPARED_GEOM
typedef struct
{
char type;
PG_LWGEOM* pg_geom1;
PG_LWGEOM* pg_geom2;
PG_LWGEOM *pg_geom1;
PG_LWGEOM *pg_geom2;
size_t pg_geom1_size;
size_t pg_geom2_size;
int32 argnum;
const GEOSPreparedGeometry* prepared_geom;
GEOSGeometry* geom;
const GEOSPreparedGeometry *prepared_geom;
GEOSGeometry *geom;
MemoryContext context;
} PrepGeomCache;
}
PrepGeomCache;
/*
/*
** Get the current cache, given the input geometries.
** Function will create cache if none exists, and prepare geometries in
** cache if necessary, or pull an existing cache if possible.
......
This diff is collapsed.
......@@ -3,9 +3,10 @@
typedef struct
{
double min;
double max;
} INTERVAL;
double min;
double max;
}
INTERVAL;
/* Returns 1 if min < value <= max, 0 otherwise */
uint32 isContained(INTERVAL *interval, double value);
......@@ -15,25 +16,26 @@ INTERVAL *createInterval(double value1, double value2);
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:
* http://lin-ear-th-inking.blogspot.com/2007/06/packed-1-dimensional-r-tree.html
*/
typedef struct rtree_node
{
INTERVAL *interval;
struct rtree_node *leftNode;
struct rtree_node *rightNode;
LWLINE* segment;
} RTREE_NODE;
INTERVAL *interval;
struct rtree_node *leftNode;
struct rtree_node *rightNode;
LWLINE *segment;
}
RTREE_NODE;
/* Creates an interior node given the children. */
RTREE_NODE *createInteriorNode(RTREE_NODE *left, RTREE_NODE *right);
/* Creates a leaf node given the pointer to the start point of the segment. */
RTREE_NODE *createLeafNode(POINTARRAY *pa, int startPoint);
/*
* Creates an rtree given a pointer to the point array.
* Must copy the point array.
/*
* Creates an rtree given a pointer to the point array.
* Must copy the point array.
*/
RTREE_NODE *createTree(POINTARRAY *pointArray);
/* Frees the tree. */
......@@ -46,13 +48,14 @@ LWMLINE *mergeMultiLines(LWMLINE *line1, LWMLINE *line2);
typedef struct
{
char type;
RTREE_NODE **ringIndices;
int ringCount;
int polyCount;
uchar *poly;
} RTREE_POLY_CACHE;
RTREE_NODE **ringIndices;
int ringCount;
int polyCount;
uchar *poly;
}
RTREE_POLY_CACHE;
/*
/*
* Creates a new cachable index if needed, or returns the current cache if
* 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