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.
  • From: Phil Scadden <P.Scadden@xxxxxxxxxx>
  • Date: Thu, 5 Dec 2019 05:33:57 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=gns.cri.nz; dmarc=pass action=none header.from=gns.cri.nz; dkim=pass header.d=gns.cri.nz; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q9Y/3TJjs21VSeCTSjfotv343qSng1VOV+bGKiduca8=; b=jAYQIwCUHfgPSA44htAXyAiwGjTrs7E+eFFR6kW+ny6RM+fZUhUDuf5zHgW26QFPLvnnxi0+xA/KOZinGSZi9PqPz8y+bVUsr2ez7JBa53d1K2K5CxGhQL7Dzntv2qeJ7Iugs0EC7hygPCvOI4IEJpm3a55NdCLBG6Esa9UKgwv7s/8cvbQDUscNbk19jPmk1JBlaXoJ9Q6cjeE4Hl+xmSwVXr6xmz6Lf7JIqp1CWpF33ylwCaZFJtXe9qNNVQAXIg1Ye9JzYvXVFZhLR32itJobGjjMf6AldUuTGKEfbo5l9D4FgpTMiwPu0mrf9/+EXw4NEDZKOTsP9THdhAydSg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GHsawdKCy/gDQrmOhNtllJYVVGY59aj3jtqNfUlBsPm0msPzU7imCe58FHhJeE3QKvaI45Ts2OwnFO5jqABLd7pYzQDaI5I1I5K03B7VtcA2YoqkdpCqMRg3Ojq+CZu/g7UGTBIeRXZ6r+aRK0M87H5AGNNcH08SKIJq4HTHkjnoRXQeFtQIwfHcjpHKj+eBvvfeGAMBx2Z4F47ECgVY8gg8OT59XuWox5UI5Jn/muSeop1PUVDOTTMzuxyW+4rmbRuEkGD5VJaN2uTgjIJYhEkaqtWy68aIRWqRnzOXPIKhJ1NaNwhUPuMZ9yrrAjcKfd+CGZ0yb3B0KcdE329B1A==
  • Delivered-to: jts-dev@xxxxxxxxxxx
  • List-archive: <https://dev.eclipse.org/mailman/private/jts-dev>
  • List-help: <mailto:jts-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://dev.eclipse.org/mailman/listinfo/jts-dev>, <mailto:jts-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://dev.eclipse.org/mailman/options/jts-dev>, <mailto:jts-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdWrIan9NR6W7lilQQCXrQPrbupfuwAB83aAAADzuQA=
  • Thread-topic: [jts-dev] best way to find all points (indexed in an SRTtree) and a polygon.

Thanks for that. I will try segmenting (since the polygon is more or less a thin rectangle). I would like to use kdtree but need to serialize.

From: jts-dev-bounces@xxxxxxxxxxx <jts-dev-bounces@xxxxxxxxxxx> on behalf of Martin Davis <mtnclimb@xxxxxxxxx>
Sent: Thursday, December 5, 2019 6:04:27 PM
To: JTS project developer mailing list <jts-dev@xxxxxxxxxxx>
Subject: 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?

Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.

Back to the top