tag:blogger.com,1999:blog-2420860529344694449.post7136327543089117715..comments2021-05-04T11:05:53.763-07:00Comments on Lin.ear th.inking: Quirks of the "Contains" Spatial PredicateDr JTShttp://www.blogger.com/profile/02383381220154739793noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-2420860529344694449.post-45319154124439645722014-06-11T13:51:17.258-07:002014-06-11T13:51:17.258-07:00Yes, ******FF* is what I meant. Then indeed "...Yes, ******FF* is what I meant. Then indeed "A covers B" always means "B is a subset of A" if a geometric object is regarded as the set of its interior and boundary points. I think this definition would be more regular (then e. g. if A covers B and C then A also covers their intersection). But actually I don't remember having problems with it in practice (maybe haven't applied covers to empty geometry). We have used JTS in many projects, as it is an indispensable tool when handling polygons in Java, with good performance — thank you for the effort!Jaanhttps://www.blogger.com/profile/00682030596370745934noreply@blogger.comtag:blogger.com,1999:blog-2420860529344694449.post-2113196364176930822014-06-10T11:35:46.806-07:002014-06-10T11:35:46.806-07:00@Jaan,
Actually the condition "covers is fal...@Jaan,<br /><br />Actually the condition "covers is false if either geometry is empty" was something I added. The OGC SFS spec doesn't explicitly define the result if either geometry is empty - I guess they intend it to be determined by the mathematical definition.<br /><br />This may have been a mistake... I agree that it makes sense that covers should be true if B is empty. This agrees with the mathematical description.<br /><br />I think this leads to a DE-9IM pattern of ******FF* - do you agree?Dr JTShttps://www.blogger.com/profile/02383381220154739793noreply@blogger.comtag:blogger.com,1999:blog-2420860529344694449.post-28291030028559219912014-06-10T02:24:01.031-07:002014-06-10T02:24:01.031-07:00You were not exactly correct when you wrote "...You were not exactly correct when you wrote "Geometry A covers Geometry B iff no points of B lie in the exterior of A". The Javadoc of Geometry.covers in JTS says there is an exception: "If either geometry is empty, the value of this predicate is false." (Without the exception, the predicate would also be true whenever B is empty.) I think that's the counter-intuitive thing about "covers". Or at least contradicting the expectation that "contains" and "covers" mean the same as in set theory (ubiquitous in modern mathematics). ("Contains" has unfortunately also other reasons why it doesn't work as in set theory, even if we identify a geometry with the set of its interior points.) Without this exception, the definition of "covers" would also be simpler in terms of the DE-9IM matrices (one mask matrix needed instead of four), so I wonder, why this exception was added to the standard (it comes from OGC standard, does it?).Jaanhttps://www.blogger.com/profile/00682030596370745934noreply@blogger.comtag:blogger.com,1999:blog-2420860529344694449.post-60198539681744019882010-05-19T13:37:27.813-07:002010-05-19T13:37:27.813-07:00Yes, good point. I'd overlooked that detail i...Yes, good point. I'd overlooked that detail in their definition. And it looks like their definition follows the original proposal by Egenhofer in <i>Point-Set Topological Spatial Relations</i>.<br /><br />But I have to say that the Egenhofer definitions seem to be pedantic rather than actually useful. I can't imagine when I'd use the Oracle definition, whereas I think the JTS definition of "covers" is obviously useful (for reasons I explained in the post. Plus it's more efficient to execute.<br /><br />So I'm not really inclined to change it...Dr JTShttps://www.blogger.com/profile/02383381220154739793noreply@blogger.comtag:blogger.com,1999:blog-2420860529344694449.post-73835996860390782582010-05-18T03:01:49.974-07:002010-05-18T03:01:49.974-07:00Oracle seems to have a different understanding of ...Oracle seems to have a different understanding of 'Covers':<br /><br /><i>COVERS: The interior of one object is completely contained in the interior or the boundary of the other object and their boundaries intersect.</i><br /><br />http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_intro.htm#i880253Unknownhttps://www.blogger.com/profile/03932847231139988525noreply@blogger.com