[postgis-devel] Intersection speedups

strk at refractions.net strk at refractions.net
Thu Sep 8 03:09:09 PDT 2005


[ moved to postgis-devel ]

On Wed, Sep 07, 2005 at 02:32:57PM -0700, Martin Davis wrote:
> Maybe this is because distance is doing a complete PIP check for each
> <polygon, polygon> pair?  That's still pretty inefficient for most
> cases.

Like queryByShape distance2d_poly_poly() initially tests PIP with
a single point (first one) of both geometries.
If both PIP returns false then it computes minimum distance between
every pair of segments, early returning if a 0.0 distance is found
(segments intersection).

--strk;

> 
> Martin Davis, Senior Technical Architect
> Vivid Solutions Inc.      www.vividsolutions.com
> Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
> Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046
> 
> 
> > -----Original Message-----
> > From: postgis-users-bounces at postgis.refractions.net 
> > [mailto:postgis-users-bounces at postgis.refractions.net] On 
> > Behalf Of Ethan Alpert
> > Sent: September 7, 2005 2:18 PM
> > To: strk at refractions.net
> > Cc: PostGIS Users Discussion
> > Subject: RE: [postgis-users] Why does this take almost 3 hours?
> > 
> > 
> > 
> > In my previous posts on this I gave my results with distance 
> > =0 it reduced my time down to 30 minutes...still far slower 
> > than the 2 minutes queryByShape takes.
> > 
> > -e
> > 
> > -----Original Message-----
> > From: strk at refractions.net [mailto:strk at refractions.net] 
> > Sent: Wednesday, September 07, 2005 12:41 PM
> > To: Ethan Alpert
> > Cc: PostGIS Users Discussion
> > Subject: Re: [postgis-users] Why does this take almost 3 hours?
> > 
> > 
> > On Tue, Aug 30, 2005 at 11:00:35AM -0600, Ethan Alpert wrote:
> > > 
> > > I need real intersection and queryByShape() produces the exact same
> > > selection as my postgis query.
> > 
> > Ethan, did/could you try using distance(geom,geom) = 0 ?
> > We're reasoning about speeding up strategies for your kind of query
> > 
> > --strk;
> > _______________________________________________
> > postgis-users mailing list postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> > 



More information about the postgis-devel mailing list