[postgis-devel] Transform fails in new transform caching code

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Mon Nov 28 08:29:31 PST 2005

> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net [mailto:postgis-devel-
> bounces at postgis.refractions.net] On Behalf Of Jeremy Palmer
> Sent: 25 November 2005 21:35
> To: 'PostGIS Development Discussion'
> Subject: RE: [postgis-devel] Transform fails in new transform caching code


> Hi Mark,
> Thanks for the reply. I followed your suggestions and have upgraded to the
> latest cvs. The problem seems to have gone away for the moment. It still
> seems a little strange. I have defined PROJ4_CACHE_DEBUG as recommended
> and
> will see if anything like this happens again during my testing this week.
> As a side question, I noticed when looking through the lwgeom_transform.c
> source that the proj cache size is hard set to 8. Is there a reason for
> this? Why not just have a cache as large as require for the transaction? I
> suppose for my query I can just sort by srid to minimise the number of db
> lookups, but this will not always be appropriate.
> Thanks for your help
> Jeremy

Hi Jeremy,

As strk points out, there is one entry per projection used for your
transformation. The cache is FIFO, so if it gets full then it will delete
the first free entry and store the next lookup there. Therefore if you are
loading in large chunks in each projection (say in blocks of several tens of
thousands of geometries per projection) then you should see most of the
speed benefit. If you feel that the default cache size of 8 SRIDs per portal
is too small for your application, then please argue a case for a larger
value :)

Also glad to hear that everything is now working for you - it would be
interesting to see how the speed compares to 1.0.5 in your tests on
extremely large tables.

Kind regards,


WebBased Ltd
17 Research Way

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


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

More information about the postgis-devel mailing list