Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a point layer and a polyline layer. I want to select all points in the point layer that are not snapped to a vertex in the polyline layer. How can I accomplish this? I'm using MapInfo and hoping that some SQL select statement can do the trick, but I'm happy with solutions using other GIS packages/program languages as well.

share|improve this question
up vote 3 down vote accepted

In pretty much any GIS you just need to do an SQL Select query something like the following:

select Points.ID from Points, Lines where Lines.obj Intersects Points.obj

And then reverse the selection.

In Mapinfo this requires using the Query -> SQL Select dialog box and putting "Points.ID" in the Select Columns box, "Points, Lines" in the from tables box and "Lines.obj Intersects Points.obj" in the where Condition box.

Then select the table and do Query -> Invert Selection, which will give you all points that do not intersect a line object.

Please note that you should replace Points and Lines with the real name of your points table and Lines table, but keep the suffixes. Also this will only work where the points are on a vertex of a line, not half way along a line between vertices.

share|improve this answer
Exactly the answer that I wanted. Thanks! – bananafish Jan 10 '12 at 23:12

This is not a query per se but if you are doing data clean up I find a thematic can be handy to see what is not snapped. The thematic is dynamic vs a query which is a one of and you have to keep running it.

What you need to do is:

  • Create a Individual thematic
  • Select Join...
  • Join the Point table to the Line table where the Line intersects the Point
  • Put any value (for the true case) in the of box. This can be anything, I normally use 1 or true etc

The result is a thematic that updated as you drag the nodes to snap onto the line. Quite handy when you are doing clean up and need to see what you have left.

enter image description hereenter image description here

share|improve this answer
this is quite cool. thanks for the tip, very useful! – bananafish Jan 12 '12 at 19:56
A problem came up today and this technique was the perfect way to go through and fix it. So big thanks! – bananafish Feb 26 '12 at 23:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.