Quantcast
Channel: SQL Server Spatial forum
Viewing all articles
Browse latest Browse all 364

Geography / Distinctions between Contains, Within, Intersects (and related)

$
0
0

Despite several hours of searching and reading numerous questions and answers on this forum and others, I have been unable to find definitive and complete explanations for the behaviors of several of the SQL Server CLR STXxx (spatiotemporal) functions.

The documentation online - that I've been able to locate thus far - does not, for example, detail how much of one geography must be enclosed by another for a.STContains(b) to return 1, and conversely for a.STWithin(b). 

Similar cases occur to me for Intersects; for example, if a we have a

(P) Polygon(2 2, 2 10, 10 10, 10 2, 2 2),

(A) LINESTRING( 3 3, 4 4, 5 5),

(B) LINESTRING(1 1, 3 4, 6, 8),

(C) LINESTRING(1 1, 3 4, 12 15),

P.STContains(A) = 1 seems obvious.  P.STIntersects(B) = 1 and P.STIntersects(C) = 1 both seem obvious as well.  What about B.STWithin(P)?  Well most of the line exists within P, right? But P.STContains(B)?  Clearly not.

Can anyone either direct me to an appropriate source that contains authoritative and explicit definitions for all geographies (or geometries) for these (and hopefully all) of the ST functions?

Thank you very much for your help!


Viewing all articles
Browse latest Browse all 364

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>