From 5f0e8c0e3081529e91af9769671ce87b2b0a2086 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 30 Dec 2004 14:44:23 +0000 Subject: [PATCH] Added AUTOCACHE_BBOX variable, defaulting to 1. git-svn-id: http://svn.osgeo.org/postgis/trunk@1195 b70326c6-7e19-0410-871a-916f4a2858ee --- Makefile.config | 6 ++++++ lwgeom/Makefile | 2 ++ lwgeom/lwgeom_inout.c | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/Makefile.config b/Makefile.config index 41558deb9..b4fa58ce3 100644 --- a/Makefile.config +++ b/Makefile.config @@ -41,6 +41,12 @@ GEOS_DIR ?= /usr/local # USE_STATS=1 +# +# Set AUTOCACHE_BBOX to 0 if you want finer control over +# bounding box computation and caching for your geometries. +# +AUTOCACHE_BBOX ?= 1 + # # Root of the PostgreSQL source tree # If you are not building from within postgresql 'contrib' directory diff --git a/lwgeom/Makefile b/lwgeom/Makefile index db3c52ecd..a51091bb5 100644 --- a/lwgeom/Makefile +++ b/lwgeom/Makefile @@ -60,6 +60,8 @@ ifeq ($(USE_PROJ),1) override CFLAGS += -I$(PROJ_DIR)/include -DUSE_PROJ endif +override CFLAGS += -I$(PROJ_DIR)/include -DAUTOCACHE_BBOX=$(AUTOCACHE_BBOX) + override DLLLIBS += $(BE_DLLLIBS) override CXXFLAGS := $(CFLAGS) diff --git a/lwgeom/lwgeom_inout.c b/lwgeom/lwgeom_inout.c index b50e1355f..770579add 100644 --- a/lwgeom/lwgeom_inout.c +++ b/lwgeom/lwgeom_inout.c @@ -335,6 +335,9 @@ Datum LWGEOM_addBBOX(PG_FUNCTION_ARGS) char is_worth_caching_pglwgeom_bbox(PG_LWGEOM *in) { +#if ! AUTOCACHE_BBOX + return false; +#endif if ( TYPE_GETTYPE(in->type) == POINTTYPE ) return false; return true; } @@ -342,6 +345,9 @@ is_worth_caching_pglwgeom_bbox(PG_LWGEOM *in) char is_worth_caching_lwgeom_bbox(LWGEOM *in) { +#if ! AUTOCACHE_BBOX + return false; +#endif if ( TYPE_GETTYPE(in->type) == POINTTYPE ) return false; return true; } -- 2.40.0