[postgis-users] how to define an alias for && operator?

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Fri Nov 4 07:29:28 PST 2005


> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of Jean-Pierre Quirion
> Sent: 04 November 2005 15:14
> To: PostGIS Users Discussion
> Subject: RE: [postgis-users] how to define an alias for && operator?

(cut)

> The "OPERATOR 3  <<< RECHECK," line has been added. And this 
> does not work. Apparently you can not reuse a 
> strategy_number, is this right (3 in this case). [My 
> assumptions are based on 
> http://www.postgresql.org/docs/8.0/interactive/sql-createopclass.html]
> Our problem is not the operator (it works), but the 
> association with an index aka operator class. If we used a 
> new strategy number like 13, we would have to define a new 
> strategy in "lwgeom_gist.c" . I am looking for an easier solution.
> 
> Jean-Pierre


Hi Jean-Pierre,

The operator classes are defined in terms of strategy number so you will be
unable to do this. The actual modifications in lwgeom_gist.c shouldn't be
that bad though - you could probably get away with just defining a new
strategy around line 78, e.g.

#define RTNewOverlapStrategyNumber		13

And then simply replace the two occurences of "case
RTOverlapStrategyNumber:" with

case RTOverlapStrategyNumber:
case RTNewOverlapStrategyNumber:

You should then be able to add your operator by including the following line
in your operator class:

"OPERATOR 13  <<< RECHECK"


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.





More information about the postgis-users mailing list