You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/09/29 07:01:00 UTC

[jira] [Commented] (CALCITE-4186) Add ST_Covers, ST_CoveredBy, ST_Relate spatial functions

    [ https://issues.apache.org/jira/browse/CALCITE-4186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17203729#comment-17203729 ] 

Julian Hyde commented on CALCITE-4186:
--------------------------------------

In [an email on geospatial@apache.org|https://lists.apache.org/thread.html/r931fbaf041d6ccbb3a9ffe405e34d5d50ef8e5d85e68bafcfa0e1bf0%40%3Cgeospatial.apache.org%3E] George Percival remarks (lightly edited for formatting and spelling):

{quote}The links that you provide for CALCITE draw on [this blog|http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html]. The blog proposes a {{Covers}} operation. I was not familiar with Martin’s blog so had to reach out to some people more versed than me in Simple Features and the DE-9IM. Surprisingly since the blog was written in 2007 and that it also appears that {{Covers}} in in PostGIS, there is was no familiarity with Martin’s blog.

If implemented in accordance with DE-9IM, there is no need to add a {{Covers}} operation. Davis is pretty explicit in his blog about this assumption: "Polygons do not contain their boundary". But DE-9IM, Simple Features and published papers that led to the standards treat polygons as closed, i.e., the polygons contain their boundaries.
Davis’s assumption that polygons are open, i.e., don't contain their boundary, leads to a misinterpretation of the {{Contains}} operation. When implemented in accordance with the standards, the addition of {{Covers}} is not needed.

Implementing Simple Features {{Contains}} consistent with the standard is a better course than adding a {{Covers}} operation. The SF spec is free: [SF spec|https://portal.opengeospatial.org/files/?artifact_id=25354].
{quote}

I find George's argument convincing, and conclude that it is not important to implement {{ST_Covers}} and {{ST_CoveredBy}} in Calcite. {{ST_Relate}} would still be very useful.

> Add ST_Covers, ST_CoveredBy, ST_Relate spatial functions
> --------------------------------------------------------
>
>                 Key: CALCITE-4186
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4186
>             Project: Calcite
>          Issue Type: Bug
>          Components: spatial
>            Reporter: Julian Hyde
>            Priority: Major
>
> Add {{ST_Covers}}, {{ST_CoveredBy}}, {{ST_Relate}} spatial functions.
> There are [subtle differences between ST_Contains and ST_Covers|http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html]; {{ST_Covers}} is usually what you want, and is easier to compute.
> Extend the Hilbert spatial index (added in CALCITE-1861) to handle {{ST_Covers}}, {{ST_CoveredBy}}, {{ST_ContainsPropertly}} as it does {{ST_DWithin}} and {{ST_Contains}}.
> It might make sense to also implement {{ST_ExteriorRing}} so that we can implement the [PostGIS example|https://postgis.net/docs/ST_Covers.html].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)