]> granicus.if.org Git - postgis/commitdiff
Reduce paranoia in ST_MakeValid
authorSandro Santilli <strk@keybit.net>
Thu, 26 Nov 2015 13:00:21 +0000 (13:00 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 26 Nov 2015 13:00:21 +0000 (13:00 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14438 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeom_geos_clean.c

index f37e775cd3d5b3262ac757fce774eafea2868160..9dd159e10a99b4c0be8cdd4d2fe058c4ad2d62f7 100644 (file)
@@ -44,6 +44,7 @@
 #include <assert.h>
 
 /* #define POSTGIS_DEBUG_LEVEL 4 */
+/* #define PARANOIA_LEVEL 2 */
 #undef LWGEOM_PROFILE_MAKEVALID
 
 
@@ -951,6 +952,7 @@ LWGEOM_GEOS_makeValid(const GEOSGeometry* gin)
        }
        }
 
+#if PARANOIA_LEVEL > 1
        /*
         * Now check if every point of input is also found
         * in output, or abort by returning NULL
@@ -958,10 +960,6 @@ LWGEOM_GEOS_makeValid(const GEOSGeometry* gin)
         * Input geometry was lwgeom_in
         */
        {
-               const int paranoia = 2;
-               /* TODO: check if the result is valid */
-               if (paranoia)
-               {
                        int loss;
                        GEOSGeometry *pi, *po, *pd;
 
@@ -981,8 +979,8 @@ LWGEOM_GEOS_makeValid(const GEOSGeometry* gin)
                                lwnotice("Vertices lost in LWGEOM_GEOS_makeValid");
                                /* return NULL */
                        }
-               }
        }
+#endif /* PARANOIA_LEVEL > 1 */
 
 
        return gout;