[postgis-users] Re: geos based spatial queries

Martin Davis mbdavis at VividSolutions.com
Mon Nov 24 16:40:17 PST 2003


When we get JTS (& GEOS) spatial predicates properly optimized this might speed up substantially.  The goal is to cache topological information for the test geometry involved in comparisons.  JTS contains code that is specially designed to perform point-in-polygon tests efficiently (better than the GIST index would).  The trick is to get it in place so it can be invoked appropriately.  

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.
Suite #1A-2328 Government Street   Victoria, B.C.   V8T 5G5
Phone: (250) 385 6040 - Local 308      Fax: (250) 385 6046



> -----Original Message-----
> From: David Blasby [mailto:dblasby at refractions.net]
> Sent: Monday, November 24, 2003 3:02 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Re: geos based spatial queries
> 
> 
> Peter Aberline wrote:
> > I'm currently trying to do a selection using the Query 2 
> syntax from the
> > points table that fall within the US coastline, represented 
> by a 950000
> > vertex polygon. The query is selecting from the same points 
> table (1.6
> > million records). There are GIST indexes on both table's 
> geometry cols, and
> > I'm expecting only a couple of hundred points to fall 
> outside the border.
> > This query is performing very, very slowly - it's been 
> going for over 48
> > hours now! Does anyone have any idea of why this is taking 
> so long? Is
> > query time using "distance" a factor of both the area and number of
> > vertices in the containing polygon?
> 
> This is taking long because its probably doing 1.6 million 
> point-in-polygon operations.
> 
> 
> Your polygon is also very large (1 million vertexes).
> 
> So, its doing 1.6 million * 1 million operations!
> 
> 
> The easiest way to fix this is to break your "continent" in 
> to a large 
> number of smaller polygons.
> 
> 
> But, you are still going to be doing about 1.6 million 
> point-in-polygons.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 



More information about the postgis-users mailing list