0

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 http://www.freeimagehosting.net/uploads/cf344d3fe2.jpg

Jacques Bosch
  • 2,165
  • 3
  • 25
  • 36
  • 1
    What is "the envelope of the line"? How can a point intersect it? For that matter, how can a point intersect anything? –  Jun 10 '10 at 12:40
  • Correct me if I'm wrong, but it is the smallest "rectangle" (polygon with 4 points) in which a geometry will fit. Any point within that envelope will be returned by an intersection query. – Jacques Bosch Jun 10 '10 at 13:15
  • @Jacques Bosch: Thanks. I didn't learn math and geometry in English. –  Jun 10 '10 at 14:17
  • @Developer Art: I'm not sure I under stand what you are getting at, nor why you commented in the first place if you are not familiar with Arc Objects. :) – Jacques Bosch Jun 10 '10 at 15:42
  • Because I was genuinely interested in the question. I understood your explanation but I had no idea what these English terms referred to. Never mind. –  Jun 10 '10 at 15:59
  • OK, I have no problem with a genuine interest. :) What it sounded like was that you were knowledgeable about the topic, and were implying there was a fundamental error in my question. Perhaps you could have started your question with something like, "Being unfamiliar with this topic, ...". But on the other hand, maybe I'm just a bit touchy, like one of the developer types in your blog. ;) Arcobjects is all about GIS which is all about maps. The diagrams at this URL will help you to visualize the envelope for a polygon. The envelope for a line will work similarly. http://bit.ly/aXcOvR Cheers :) – Jacques Bosch Jun 10 '10 at 18:31
  • @Jacques Bosch: No offense was intended. I apologize for the choice of words which turned out to be unfortunate. –  Jun 10 '10 at 19:03
  • @Developer Art: Not a problem. At least our comments make this question more interesting. :) – Jacques Bosch Jun 11 '10 at 07:17
  • @Developer Art: Envelope is probably more commonly known as a Minimum Bounding Rectangle, or MBR. http://en.wikipedia.org/wiki/Minimum_bounding_rectangle – Kirk Kuykendall Jun 15 '10 at 19:20
  • @Kirk Kuykendall: Thanks. It looks more familiar to me. –  Jun 16 '10 at 08:08
  • I thought everybody called those things AABB's. – Steven Lu Dec 21 '11 at 03:49

1 Answers1

1

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
  • 822
  • 1
  • 12
  • 26