[postgis-tickets] [PostGIS] #4749: Improve behaviour of spatial predicates with GeometryCollection inputs

PostGIS trac at osgeo.org
Tue Sep 8 17:23:41 PDT 2020


#4749: Improve behaviour of spatial predicates with GeometryCollection inputs
--------------------------+---------------------------
  Reporter:  mdavis       |      Owner:  pramsey
      Type:  enhancement  |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS 3.1.0
 Component:  postgis      |    Version:  2.5.x
Resolution:               |   Keywords:
--------------------------+---------------------------

Comment (by mdavis):

 Replying to [comment:2 Algunenano]:
 > > The following cases cannot be handled easily. They should report a
 appropriate, informative error:
 >
 > The main issue I see with this is that chaining calls might bug out for
 no good reason as current geos predicates return GeometryCollections. For
 example, with this change `ST_Intersects(ST_Intersection(A, B), C)` will
 fail if the result of `ST_Intersection(A, B)` returns a GC of a polygon
 and a line.

 To be clear, it is the **overlay** functions which can return mixed-type
 geometry.  The current **spatial predicates** do not handle mixed geometry
 inputs, so this is not regressing that behaviour.

 The goals of this suggestion are:
 * eliminate segfaults
 * provide better error messages to the user
 * (perhaps) extend the predicate domain to handle more inputs (at the
 price of more processing)

 I agree that it would be useful to extend the domain of some of the
 predicates (in particular, `ST_Intersects`) to handle mixed geometry
 inputs.  This should be feasible, and hopefully can be done in subsequent
 development.

 > we should have a good base so we stop getting those random
 `TopologyException` that everybody dislikes.

 To be clear, the `TopologyException` thrown by the example above occurs
 because the predicate code is exposing too much of the internal logic.
 That's why I suggest replacing that error message with something useful,
 such as "Mixed-type collections not allowed" or "Collection is not a valid
 MultiPolygon".

 Don't confuse this with the `TopologyException`s thrown by the overlay
 code. Those are robustness issues rather than input limitations.  We are
 hoping that OverlayNG eliminates them completely.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4749#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list