[postgis-tickets] r15431 - Add test for multi-arch curve

Sandro Santilli strk at kbt.io
Mon Jun 19 09:07:08 PDT 2017


Author: strk
Date: 2017-06-19 09:07:08 -0700 (Mon, 19 Jun 2017)
New Revision: 15431

Modified:
   trunk/regress/curvetoline.sql
   trunk/regress/curvetoline_expected
Log:
Add test for multi-arch curve

It shows how MaxError configuration for ST_CurveToLine is useful
as it results in different number of segments per quadrant based
on radius of each arc...

Modified: trunk/regress/curvetoline.sql
===================================================================
--- trunk/regress/curvetoline.sql	2017-06-19 16:06:59 UTC (rev 15430)
+++ trunk/regress/curvetoline.sql	2017-06-19 16:07:08 UTC (rev 15431)
@@ -48,5 +48,17 @@
 	2, -- Above is max angle between generating radii
 	3  -- Symmetric and RetainAngle flags
 ), 2));
+SELECT 'multiarch1', ST_AsText(ST_SnapToGrid(ST_CurveToLine(
+ 'CIRCULARSTRING(0 0,100 -100,200 0,400 200,600 0)'::geometry,
+	radians(45), -- Tolerance
+	2, -- Above is max angle between generating radii
+	3  -- Symmetric and RetainAngle flags
+), 2));
+SELECT 'multiarch1.maxerr20.sym', ST_AsText(ST_SnapToGrid(ST_CurveToLine(
+ 'CIRCULARSTRING(0 0,100 -100,200 0,400 200,600 0)'::geometry,
+	20, -- Tolerance
+	1, -- Above is max distance between curve and line
+	1  -- Symmetric
+), 2));
 
 

Modified: trunk/regress/curvetoline_expected
===================================================================
--- trunk/regress/curvetoline_expected	2017-06-19 16:06:59 UTC (rev 15430)
+++ trunk/regress/curvetoline_expected	2017-06-19 16:07:08 UTC (rev 15431)
@@ -4,3 +4,5 @@
 semicircle3|LINESTRING(0 0,24 -64,82 -98,150 -86,194 -34,200 0)
 semicircle3.sym|LINESTRING(0 0,20 -58,70 -96,130 -96,180 -58,200 0)
 semicircle3.sym.ret|LINESTRING(0 0,14 -50,66 -94,134 -94,186 -50,200 0)
+multiarch1|LINESTRING(0 0,30 -70,100 -100,170 -70,200 0,258 142,400 200,542 142,600 0)
+multiarch1.maxerr20.sym|LINESTRING(0 0,50 -86,150 -86,200 0,258 142,400 200,542 142,600 0)



More information about the postgis-tickets mailing list