]> granicus.if.org Git - postgis/commitdiff
Pick curve control point farther than in the middle
authorSandro Santilli <strk@keybit.net>
Tue, 13 Aug 2013 23:47:54 +0000 (23:47 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 13 Aug 2013 23:47:54 +0000 (23:47 +0000)
Seems to get a good point when doing manual tests...

git-svn-id: http://svn.osgeo.org/postgis/trunk@11793 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/cunit/cu_ptarray.c
liblwgeom/lwsegmentize.c
regress/tickets_expected

index 2a6126cb0a37285b0acb35b7f41f25e083bbf85c..933aa062ead5aec5612cb636f2bcec170b4d07b6 100644 (file)
@@ -399,7 +399,7 @@ static void test_ptarray_desegmentize()
   in = out;
        out = lwgeom_desegmentize(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
-       CU_ASSERT_STRING_EQUAL(str, "COMPOUNDCURVE((0 0,1 1),CIRCULARSTRING(1 1,1.8049097 1.9807853,3 1),(3 1,4 4))");
+       CU_ASSERT_STRING_EQUAL(str, "COMPOUNDCURVE((0 0,1 1),CIRCULARSTRING(1 1,2 2,3 1),(3 1,4 4))");
        lwgeom_free(in);
        lwgeom_free(out);
 //     printf("%s\n", str);
index f49e0afbc0929e9eede4af2bc5e8bcc2ecc4c96d..2fd5d063ea80c0f7177981763d25121748ad7fc0 100644 (file)
@@ -565,7 +565,7 @@ circstring_from_pa(const POINTARRAY *pa, int srid, int start, int end)
        LWDEBUGF(4, "srid=%d, start=%d, end=%d", srid, start, end);
        getPoint4d_p(pa, start, &p0);
        ptarray_set_point4d(pao, 0, &p0);       
-       getPoint4d_p(pa, (start+end)/2, &p1);
+       getPoint4d_p(pa, (start+end+1)/2, &p1);
        ptarray_set_point4d(pao, 1, &p1);       
        getPoint4d_p(pa, end+1, &p2);
        ptarray_set_point4d(pao, 2, &p2);       
index b6ef35e88cbac3577ab4946bc39944eabf52a8f3..6dd393717c27ebb58a93d42edb3522e748ba5798 100644 (file)
@@ -40,7 +40,7 @@ NOTICE:  No points or linestrings in input array
 #179a|
 NOTICE:  No points or linestrings in input array
 #179b|
-#183|COMPOUNDCURVE(CIRCULARSTRING(0 0,0.4653039147 1.2062550401,1 0),(1 0,0 1))
+#183|COMPOUNDCURVE(CIRCULARSTRING(0 0,0.5 1.2071067812,1 0),(1 0,0 1))
 #210a|
 NOTICE:  No points or linestrings in input array
 #210b|
@@ -95,7 +95,7 @@ NOTICE:  IllegalArgumentException: Invalid number of points in LinearRing found
 #835.11|MULTILINESTRING EMPTY
 #835.12|MULTIPOLYGON EMPTY
 #650|MULTIPOINT(0 0,1 1,2 2)
-#667|SRID=4326;CURVEPOLYGON(CIRCULARSTRING(30 40,-49.2314112161292 32.1963871193548,30 40))
+#667|SRID=4326;CURVEPOLYGON(CIRCULARSTRING(30 40,-50 39.9999999999999,30 40))
 #677|1121395
 #680|01d107000000000000000024c000000000000049400000000000000040
 #681a|