I try to understand the Spatial predicates of the DE-9IM Intersection matrix. I don't get the difference between predicates Covers (respective CoveredBy) and Contains (resp. Within).
I try to draw geometries with JTS Topology Suite, they are always Covers = True
and Contains = True
(or both are False) but I don't manage to make them different, i.e. to see the difference between Covers
and Contains
. Does anybody have an example (preferably an WKT or a picture) which illustrate the difference?
Best Answer
Look at Martin Davis (creator of the JTS Topology Suite), Lin.ear th.inking: Quirks of the "Contains" Spatial Predicate
If you look at DE-9IM, you can see that contains
(T*****FF*)
is a particular case of covers(T*****FF*, *T****FF*, ***T**FF*)
For example, the definition of contains implies that a Polygon do not contain its boundary but a Polygon covers its boundary.