[postgis-devel] Common Code

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Wed Aug 10 04:15:37 PDT 2011


On 10/08/11 01:45, Bryce L Nordgren wrote:

> What about putting this in fn_extra:
>
> struct uber_cache_monster {
>     RTREE_POLY_CACHE *r_tree ;
>     RTREE_POLY_CACHE *prepped_geoms ;
>     PROJ4PortalCache *projections ;
> } ;
>
> It doesn't solve the duplicate code issue, but it should fix #547.
> Which, now that I look at it, is exactly what you suggested in the
> ticket. (http://trac.osgeo.org/postgis/ticket/547#comment:4) Nevermind
> me, I'm just catching up.

I think this is the way to go, as the pointer to this structure would be 
the unique entry for the caching API.

> BTW: is fn_extra private to postgis, or is it shared among other
> extensions (which may also want to use it)?

It's actually a spare pointer within the function node of the query tree 
which can be used for storing random "extra" data. It's lifespan is just 
the duration of that particular query.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs



More information about the postgis-devel mailing list