Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jts-dev] best way to find all points (indexed in an SRTtree) and a polygon.

The spatial indexes in JTS generally only support range rectangle queries.  So there's no way to get any more out of the index than by querying using the envelope of the polygon (a so-called "primary filter").  The secondary filter tests whether the retrieved points actually lie in the query polygon.  That can be done most efficiently by using a PreparedGeometry and its intersects() method.

You might also consider using the KdTree class - it should be faster for indexing points.  

On Wed, Dec 4, 2019 at 8:20 PM Phil Scadden <P.Scadden@xxxxxxxxxx> wrote:

I have a rather large no. of points which I have indexed as an SRTree. I want to find list of all of points which lie inside a polygon (which is derived by buffering a line). An envelope query on the tree would obviously reduce the no. of points to check well for an EW or NS line, but what would be the best way to exploit the index for a diagonal line?


Back to the top