[postgis-devel] r15336 - #3589, Orientation checking and forcing fuctions

Daniel Baston dbaston at gmail.com
Fri Mar 17 06:31:33 PDT 2017


It returns true so that the functions are internally consistent, i.e.
whenever ST_OrderingEquals(geom, ST_ForcePolygonCCW(geom)) is true then
ST_IsPolygonCCW(geom) must also be true.  One way to think of it is that
the function is telling you whether all of the polygons in the input are
oriented CCW.  If you have zero polygons, then all of the polygons are
oriented CCW.  In addition to internal consistency, this allows the
functions to work on geometry collections that contain mixed geometry types
(say, a polygon and a point).

One application of the function is to test whether an arbitrary geometry
will behave correctly in software that requires a particular orientation,
without having to separately test the type of the geometry.

Do you want to explain a bit about why you don't like it?  Is there a use
case that benefits from the NULL return?

Dan

On Fri, Mar 17, 2017 at 3:19 AM, Sandro Santilli <strk at kbt.io> wrote:

> On Thu, Mar 16, 2017 at 05:28:07PM -0700, Daniel Baston wrote:
> > Author: dbaston
> > Date: 2017-03-16 17:28:07 -0700 (Thu, 16 Mar 2017)
> > New Revision: 15336
>
> > +                                             <function>ST_IsPolygonCCW</
> function>
> ...
> > +                             Returns true for all non-polygonal
> geometries.
>
> I don't like this approach. Why true ? I'd rather see a NULL return
> there, if you don't want to be hit by an exception.
>
> What do others think about this ?
>
> --strk;
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20170317/7a8de593/attachment.html>


More information about the postgis-devel mailing list