[postgis-users] Is my query planner failing me, or vice versa?

Martin Davis mbdavis at VividSolutions.com
Tue Dec 13 17:35:39 PST 2005


> Martin, postgis worst case for Distance is O(nm), what should 
> we expect from JTS ?

In JTS distance uses essentially the same algorithm as PostGIS, so it's
O(nm).  I think you can do better than this with some fancy algorithms,
but I haven't implemented those ideas yet.

It's worth noting that what is really being asked is whether
g.isWithinDistance(h, 5000) = true.  IsWithinDistance allows even more
optimization than distance - but unfortunately JTS doesn't implement
those optimizations yet (apart from a simple bounding box check).

The convex hull idea is a good one.  By the way, I've been doing some
work on the JTS convex hull routines recently, and made a huge speedup
over the old one.  Strk, might be work taking a look at that code to see
about porting it to GEOS.  Shouldn't be too hard to do - the algorithm
is basically the same, it's just more carefully implemented.

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: strk at refractions.net [mailto:strk at refractions.net] 
> Sent: December 13, 2005 4:54 PM
> To: PostGIS Users Discussion
> Cc: Martin Davis
> Subject: Re: [postgis-users] Is my query planner failing me, 
> or vice versa?
> 
> 
> On Tue, Dec 13, 2005 at 05:08:07PM -0700, Jessica M Salmon wrote:
> > Strk -
> > 

> 



More information about the postgis-users mailing list