[postgis-users] Function OVERLAPS() versus &&

strk at refractions.net strk at refractions.net
Fri Jan 14 10:46:37 PST 2005


On Fri, Jan 14, 2005 at 10:04:54AM -0800, James G Wilkinson wrote:
> Here is an example query:
> 
> CREATE TALBE us_pophu_prj AS
>                SELECT a.gid, b.gid AS sec_gid, 
> GEOMUNION(a.the_geom,b.the_geom)
>                FROM us_pophu a, us_tribes b
>                WHERE a.the_geom && b.the_geom AND 
> OVERLAPS(a.the_geom,b.the_geom);
> 
> My questions are as follows:
> 
> (1) Are the use of the '&&' clause and the function OVERLAPS() redundant?

No. && only checks for bounding box overlap, overlaps() performs
topological overlap.

> (2) I know that '&&' will use the GiST index, but does the function 
> OVERLAPS()
> use the GiST index?

No, only operators are allowed to use indexes.

> (3) Is the query I pose the most efficient way to union the two coverages?

You should probably avoid union of a geom with itself ...
AND a.gid != b.gid 

--strk;

> 
> Regards,
> 
> Jim
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-- 

For standing up against patentability of software,

  Thank You, Poland!

Read the intervention:    http://kwiki.ffii.org/ConsPolon041221En
Send your thanks:         thankyoupoland.info
Read/do more:		  http://www.noepatents.org/



More information about the postgis-users mailing list