tags:

views:

57

answers:

1

I have 2 layers. A lines layer and a points layer.

For any given line, how can I find the points that intersect the envelope of the line, but not the line itself, or more specifically, not the to point or from point of the line.

I can obviously find all the points that intersect the line's envelope, and then do 1 by 1 tests on the found points to see if they intersect the to or from points of the line, but I was hoping there is an easier, faster way to do something of this nature.

Edit:

An envelope or extent of a geometry is the smallest rectangle (polygon with 4 points) in which the geometry (polygon, polyline, line, etc.) will fit. The below diagram illustrates the envelope for a polygon, but a polyline will work similarly. Envelope

+1  A: 

To find all points in the points layer that do not intersect an endpoint of a line in the lines layer, I would do this:

  1. Create a Dictionary<string,IPoint> of points in the points layer.
  2. Create a Dictionary<string,IPoint> of endpoints in the lines layer.
  3. Loop through each key in the first dictionary and check to see if the key exists in the second dictionary.

The string key is based on a concatenation of X, comma, and Y.

Kirk Kuykendall
Such a simple and obvious solution. Thanx. :)
Jacques Bosch

related questions