0

In short, are STDisjoint() and STIntersects() antipodes of each other? According to the documentation, it seems that they are. But there is no explicit note about it.

Are there any tricks? Which one is faster, for example?

1 Answer 1

1

Mathematically, disjoint = not intersects.

As to which is faster, according to the documentation on spatial indexes at http://msdn.microsoft.com/en-us/library/bb895265.aspx#methods , a spatial index can be used for a query containing geometry1.STIntersects(geometry2) = 1.

Strangely enough, geometry1.STDisjoint(geometry2) = 0 is not listed.

3
  • It seems that I miss something in the mathematical definitions of these operations. Could you provide a link to materials about them? BTW thx for the answer. Indexing is quite important in my task. Commented Aug 14, 2014 at 8:32
  • en.wikipedia.org/wiki/Disjoint_sets Commented Aug 14, 2014 at 9:01
  • @Colin'tHart Probably for the same reason that column = @X can use an index while column <> @X usually doesn't. Commented Aug 14, 2014 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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