[postgis-tickets] r17210 - Speedup concave_hull_hard test

Raul raul at rmr.ninja
Tue Jan 22 04:29:06 PST 2019


Author: algunenano
Date: 2019-01-22 04:29:06 -0800 (Tue, 22 Jan 2019)
New Revision: 17210

Modified:
   trunk/regress/core/concave_hull_hard.sql
Log:
Speedup concave_hull_hard test

Closes #4306


Modified: trunk/regress/core/concave_hull_hard.sql
===================================================================
--- trunk/regress/core/concave_hull_hard.sql	2019-01-22 11:50:59 UTC (rev 17209)
+++ trunk/regress/core/concave_hull_hard.sql	2019-01-22 12:29:06 UTC (rev 17210)
@@ -53,8 +53,16 @@
 \set QUIET off
 SET client_min_messages TO NOTICE;
 
-SELECT '#3697', ST_Area(ST_Intersection(geom,ST_ConcaveHull(geom, 0.8) )) = ST_Area(geom) As encloses_geom,
-(ST_Area(ST_ConvexHull(geom)) - ST_Area(ST_ConcaveHull(geom, 0.8))) < (0.8 * ST_Area(ST_ConvexHull(geom) ) ) As reached_target
-FROM big_polygon;
+WITH intermediate AS
+(
+    SELECT ST_ConcaveHull(geom, 0.8)    as concave,
+           ST_Area(ST_ConvexHull(geom)) as convex_area,
+           geom                         as geom
+    FROM big_polygon
+)
+SELECT '#3697',
+        ST_Area(ST_Intersection(geom,concave)) = ST_Area(geom) As encloses_geom,
+        (convex_area - ST_Area(concave) < (0.8 * convex_area)) As reached_target
+FROM intermediate;
 
 drop table big_polygon;



More information about the postgis-tickets mailing list