[postgis-devel] Transform() PROJ4 cache patch

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Tue Nov 1 14:34:37 PST 2005


> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net 
> [mailto:postgis-devel-bounces at postgis.refractions.net] On 
> Behalf Of Mark Cave-Ayland
> Sent: 01 November 2005 12:06
> To: 'PostGIS Development Discussion'
> Subject: RE: [postgis-devel] Transform() PROJ4 cache patch

(cut)

> > Great work Mark.
> > 
> > I tested your code against 7.2.1, but it doesn't compile:
> > 
> > gcc -DUSE_VERSION=72 -DPOSTGIS_LIB_VERSION='"1.1.0CVS"'
> > -DPOSTGIS_SCRIPTS_VERSION='"0.3.1"' 
> > -DPOSTGIS_BUILD_DATE='"2005-11-01 10:37:45"' 
> > -I/usr/home/strk/extra/proj-4.4.5//include -DUSE_PROJ  
> > -I/pgroot-7.2.1/include/postgresql/server -DAUTOCACHE_BBOX=1  
> > -DUSE_STATS -Wall -g -O2 -fPIC -fexceptions -DUSE_GEOS    -c 
> > -o lwgeom_transform.o lwgeom_transform.c
> > lwgeom_transform.c:84: warning: excess elements in struct 
> initializer
> > lwgeom_transform.c:84: warning: (near initialization for 
> > `PROJ4SRSCacheContextMethods')
> > lwgeom_transform.c:89: warning: excess elements in struct 
> initializer
> > lwgeom_transform.c:89: warning: (near initialization for 
> > `PROJ4SRSCacheContextMethods')
> > lwgeom_transform.c: In function `AddToPROJ4SRSCache':
> > lwgeom_transform.c:196: warning: implicit declaration of 
> > function `SPI_execute'
> > lwgeom_transform.c: In function `transform':
> > lwgeom_transform.c:493: `MessageContext' undeclared (first 
> > use in this function)
> > lwgeom_transform.c:493: (Each undeclared identifier is 
> > reported only once
> > lwgeom_transform.c:493: for each function it appears in.)
> > 
> > 
> > --strk;


Hi strk,

Please find enclosed a revised version of the patch for testing. I've moved
all of the caching code into lwgeom_transform_cache.c/h and changed the
memory context for the cache to be QueryContext, since MessageContext is
designed to hold information slightly longer than required. I've also added
code in lwgeom_transform_cache.c to set the correct MemoryContextMethods
structure depending upon the version of PostgreSQL (although I haven't been
able to test it against any older versions since all our installations are
now PostgreSQL 8.0!) and reverted to using the older SPI_exec() instead of
SPI_execute().


Kind regards,

Mark.

------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023

http://www.webbased.co.uk   
http://www.infomapper.com 
http://www.swtc.co.uk  

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other
person.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transform_cache_postgis-1.0.4.patch
Type: application/octet-stream
Size: 21740 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20051101/7a49ed2e/attachment.obj>


More information about the postgis-devel mailing list