Skip to content

Predicates should work on Geometry not SpatialObject #642

@VladimirAlexiev

Description

@VladimirAlexiev

Predicates are defined with domain=range=SpatialObject. That is an abstract class that includes Feature and Geometry.

Imagine a database of features and respective geometries, where 1k pairs satisfy sfWithin.

What is ?x geo:sfWithin ?y supposed to return?

  • 1k Geometry pairs , or
  • 1k Feature pairs, or
  • 1k <Geometry, Feature> pairs, or
  • ...
  • 4k pairs <Geometry|Feature, Geometry|Feature>

Because of the union nature of SpatialObject, the last bullet is suggested.. but that's absurd.

And there's another problem: a Feature can have multiple Geometries:

  • "equivalent" but using different SRS
  • or even non-equivalent: centroid vs bbox vs detailed; time-dependent; at high/low tide, etc

Say you have F1.G1 (centroid), F1.G2 (polygon), F2.G1 (polygon). And say that F1.G1 is within F2.G1 but F1.G2 is not within F2.G1. What should "F1 within F2" return?

Unfortunately the standard gives no examples of predicate use. Nor does it say something like:
"If a Feature has only one Geometry then it can be used in or returned by spatial predicates"

It poses equivalence of predicates and functions, but how can that be if predicates work on SpatialObject and functions only on geomLiteral?

I suggest to change domain=range=Geometry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions