]> granicus.if.org Git - postgis/commitdiff
Rename _segmentize to _stroke to distinguish arc stroking routines from line densific...
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 30 Jun 2015 15:27:59 +0000 (15:27 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 30 Jun 2015 15:27:59 +0000 (15:27 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13762 b70326c6-7e19-0410-871a-916f4a2858ee

ChangeLog
liblwgeom/Makefile.in
liblwgeom/cunit/cu_ptarray.c
liblwgeom/liblwgeom.h.in
liblwgeom/liblwgeom_internal.h
liblwgeom/lwcompound.c
liblwgeom/lwcurvepoly.c
liblwgeom/lwgeom.c
liblwgeom/lwstroke.c [moved from liblwgeom/lwsegmentize.c with 82% similarity]
postgis/lwgeom_sqlmm.c

index 2d1bde092d5f0d655906aca86d24e3a08ba4575b..ef3c15a47eeed1db4f2d89e46ab8f5460af0267b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 \r
 2012-12-20 17:19  strk\r
 \r
-       * Fix memory leaks in lwsegmentize and cu_ptarray\r
+       * Fix memory leaks in lwstroke and cu_ptarray\r
 \r
 2012-12-20 16:02  robe\r
 \r
 2008-09-16 18:44  mcayland\r
 \r
        * Move the LWGEOM-specific functions from lwgeom_sqlmm.c into\r
-         liblwgeom/lwsegmentize.c to ensure that liblwgeom can exist as a\r
+         liblwgeom/lwstroke.c to ensure that liblwgeom can exist as a\r
          standalone library.\r
 \r
 2008-09-16 13:35  robe\r
index 8ec7e0898651c70fdb0ca4a462ce9ec4102b8d7c..dbcc1ed82e4ea4bad2e0a6bd69fcbd85efb460eb 100644 (file)
@@ -66,7 +66,7 @@ SA_OBJS = \
        lwutil.o \
        lwhomogenize.o \
        lwalgorithm.o \
-       lwsegmentize.o \
+       lwstroke.o \
        lwlinearreferencing.o \
        lwprint.o \
        g_box.o \
index 46e8022deb0eceb2624c917707f7ea6104acfb37..f07651cde0ccd4b1a3888e33ffc69592f7d27b01 100644 (file)
@@ -342,7 +342,7 @@ static void test_ptarray_signed_area()
 
 
 
-static void test_ptarray_desegmentize() 
+static void test_ptarray_unstroke() 
 {
        LWGEOM *in, *out;
        char *str;
@@ -351,7 +351,7 @@ static void test_ptarray_desegmentize()
           but it looks like the intersection itself is too sloppy in generating the derived point
           to accurately reconstruct the circles.
        in = lwgeom_from_text("POLYGON((0.5 0,0.471177920604846 -0.292635483024192,0.38581929876693 -0.574025148547634,0.247204418453818 -0.833355349529403,0.0606601717798223 -1.06066017177982,-5.44089437167602e-17 -1.11044268820754,-0.0606601717798188 -1.06066017177982,-0.247204418453816 -0.833355349529406,-0.385819298766929 -0.574025148547639,-0.471177920604845 -0.292635483024197,-0.5 -4.84663372329776e-15,-0.471177920604847 0.292635483024187,-0.385819298766932 0.57402514854763,-0.247204418453821 0.833355349529398,-0.0606601717798256 1.06066017177982,3.45538806345173e-16 1.11044268820754,0.0606601717798183 1.06066017177982,0.247204418453816 0.833355349529407,0.385819298766929 0.574025148547638,0.471177920604845 0.292635483024196,0.5 0))");
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        printf("%s\n", str);
        ASSERT_STRING_EQUAL(str, "CIRCULARSTRING(-1 0,0 1,0 -1)");
@@ -361,10 +361,10 @@ static void test_ptarray_desegmentize()
        */
        
        in = lwgeom_from_text("CIRCULARSTRING(-1 0,0 1,0 -1)");
-       out = lwgeom_segmentize(in,8);
+       out = lwgeom_stroke(in,8);
        lwgeom_free(in);
        in = out;
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        // printf("%s\n", str);
        ASSERT_STRING_EQUAL(str, "CIRCULARSTRING(-1 0,0.70710678 0.70710678,0 -1)");
@@ -373,10 +373,10 @@ static void test_ptarray_desegmentize()
        lwfree(str);    
 
        in = lwgeom_from_text("COMPOUNDCURVE(CIRCULARSTRING(-1 0,0 1,0 -1),(0 -1,-1 -1))");
-       out = lwgeom_segmentize(in,8);
+       out = lwgeom_stroke(in,8);
        lwgeom_free(in);
        in = out;
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        // printf("%s\n", str);
        ASSERT_STRING_EQUAL(str, "COMPOUNDCURVE(CIRCULARSTRING(-1 0,0.70710678 0.70710678,0 -1),(0 -1,-1 -1))");
@@ -385,10 +385,10 @@ static void test_ptarray_desegmentize()
        lwfree(str);    
 
        in = lwgeom_from_text("COMPOUNDCURVE((-3 -3,-1 0),CIRCULARSTRING(-1 0,0 1,0 -1),(0 -1,0 -1.5,0 -2),CIRCULARSTRING(0 -2,-1 -3,1 -3),(1 -3,5 5))");
-       out = lwgeom_segmentize(in,8);
+       out = lwgeom_stroke(in,8);
        lwgeom_free(in);
        in = out;
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        // printf("%s\n", str);
        ASSERT_STRING_EQUAL(str, "COMPOUNDCURVE((-3 -3,-1 0),CIRCULARSTRING(-1 0,0.70710678 0.70710678,0 -1),(0 -1,0 -1.5,0 -2),CIRCULARSTRING(0 -2,-0.70710678 -3.7071068,1 -3),(1 -3,5 5))");
@@ -397,10 +397,10 @@ static void test_ptarray_desegmentize()
        lwfree(str);    
 
        in = lwgeom_from_text("COMPOUNDCURVE(CIRCULARSTRING(-1 0,0 1,0 -1),CIRCULARSTRING(0 -1,-1 -2,1 -2))");
-       out = lwgeom_segmentize(in,8);
+       out = lwgeom_stroke(in,8);
        lwgeom_free(in);
        in = out;
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        // printf("%s\n", str);
        ASSERT_STRING_EQUAL(str, "COMPOUNDCURVE(CIRCULARSTRING(-1 0,0.70710678 0.70710678,0 -1),CIRCULARSTRING(0 -1,-0.70710678 -2.7071068,1 -2))");
@@ -409,10 +409,10 @@ static void test_ptarray_desegmentize()
        lwfree(str);    
        
        in = lwgeom_from_text("COMPOUNDCURVE((0 0, 1 1), CIRCULARSTRING(1 1, 2 2, 3 1), (3 1, 4 4))");
-       out = lwgeom_segmentize(in,8);
+       out = lwgeom_stroke(in,8);
        lwgeom_free(in);
        in = out;
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        ASSERT_STRING_EQUAL(str, "COMPOUNDCURVE((0 0,1 1),CIRCULARSTRING(1 1,2 2,3 1),(3 1,4 4))");
        lwgeom_free(in);
@@ -423,7 +423,7 @@ static void test_ptarray_desegmentize()
        // See http://trac.osgeo.org/postgis/ticket/2425 
        // and http://trac.osgeo.org/postgis/ticket/2420 
        in = lwgeom_from_text("LINESTRING(0 0,10 0,10 10,0 10,0 0)");
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        ASSERT_STRING_EQUAL(str, "LINESTRING(0 0,10 0,10 10,0 10,0 0)");
        lwgeom_free(in);
@@ -431,7 +431,7 @@ static void test_ptarray_desegmentize()
        lwfree(str);    
 
        in = lwgeom_from_text("LINESTRING(10 10,0 10,0 0,10 0)");
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        ASSERT_STRING_EQUAL(str, "LINESTRING(10 10,0 10,0 0,10 0)");
        // printf("%s\n", str);
@@ -440,7 +440,7 @@ static void test_ptarray_desegmentize()
        lwfree(str);
 
        in = lwgeom_from_text("LINESTRING(0 0,10 0,10 10,0 10)");
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        ASSERT_STRING_EQUAL(str, "LINESTRING(0 0,10 0,10 10,0 10)");
        // printf("%s\n", str);
@@ -450,7 +450,7 @@ static void test_ptarray_desegmentize()
 
        // See http://trac.osgeo.org/postgis/ticket/2412
        in = lwgeom_from_text("LINESTRING(0 0, 1 1)");
-       out = lwgeom_desegmentize(in);
+       out = lwgeom_unstroke(in);
        str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
        // printf("%s\n", str);
        ASSERT_STRING_EQUAL(str, "LINESTRING(0 0,1 1)");
@@ -749,7 +749,7 @@ void ptarray_suite_setup(void)
        PG_ADD_TEST(suite, test_ptarray_locate_point);
        PG_ADD_TEST(suite, test_ptarray_isccw);
        PG_ADD_TEST(suite, test_ptarray_signed_area);
-       PG_ADD_TEST(suite, test_ptarray_desegmentize);
+       PG_ADD_TEST(suite, test_ptarray_unstroke);
        PG_ADD_TEST(suite, test_ptarray_insert_point);
        PG_ADD_TEST(suite, test_ptarray_contains_point);
        PG_ADD_TEST(suite, test_ptarrayarc_contains_point);
index d1c370ac9c36ac11ba718e0a6609c6e1e7a3c9c3..11fd218d57a4cc64bcdf958095d977d254f06f76 100644 (file)
@@ -2009,8 +2009,8 @@ extern uint8_t* twkb_to_twkbcoll(uint8_t **twkb, size_t *sizes,size_t *out_size,
  ******************************************************************************/
 
 int lwgeom_has_arc(const LWGEOM *geom);
-LWGEOM *lwgeom_segmentize(LWGEOM *geom, uint32_t perQuad);
-LWGEOM *lwgeom_desegmentize(LWGEOM *geom);
+LWGEOM *lwgeom_stroke(LWGEOM *geom, uint32_t perQuad);
+LWGEOM *lwgeom_unstroke(LWGEOM *geom);
 
 /*******************************************************************************
  * GEOS proxy functions on LWGEOM
index b8ff9807a77cee6f225a0d4c2c03e9d0d868fd2a..de2a9a8e38f6397c05cb646b5014efa1ae1cc360 100644 (file)
@@ -292,9 +292,9 @@ double lwtriangle_perimeter_2d(const LWTRIANGLE *triangle);
 /*
 * Segmentization
 */
-LWLINE *lwcircstring_segmentize(const LWCIRCSTRING *icurve, uint32_t perQuad);
-LWLINE *lwcompound_segmentize(const LWCOMPOUND *icompound, uint32_t perQuad);
-LWPOLY *lwcurvepoly_segmentize(const LWCURVEPOLY *curvepoly, uint32_t perQuad);
+LWLINE *lwcircstring_stroke(const LWCIRCSTRING *icurve, uint32_t perQuad);
+LWLINE *lwcompound_stroke(const LWCOMPOUND *icompound, uint32_t perQuad);
+LWPOLY *lwcurvepoly_stroke(const LWCURVEPOLY *curvepoly, uint32_t perQuad);
 
 /*
 * Affine
index 03b40af7f67b9ad9f902c965b390319ec6f8268d..ae2286f3de26386b71b3442778641a4f46931497 100644 (file)
@@ -59,7 +59,7 @@ double lwcompound_length(const LWCOMPOUND *comp)
        LWLINE *line;
        if ( lwgeom_is_empty((LWGEOM*)comp) )
                return 0.0;
-       line = lwcompound_segmentize(comp, 32);
+       line = lwcompound_stroke(comp, 32);
        length = lwline_length(line);
        lwline_free(line);
        return length;
@@ -71,7 +71,7 @@ double lwcompound_length_2d(const LWCOMPOUND *comp)
        LWLINE *line;
        if ( lwgeom_is_empty((LWGEOM*)comp) )
                return 0.0;
-       line = lwcompound_segmentize(comp, 32);
+       line = lwcompound_stroke(comp, 32);
        length = lwline_length_2d(line);
        lwline_free(line);
        return length;
index 5619a70c9dc1cee791746af13b8983f12b82e7a3..8a6478c891b594801f975c16b161c9a10f0bd188 100644 (file)
@@ -123,7 +123,7 @@ lwcurvepoly_area(const LWCURVEPOLY *curvepoly)
        LWPOLY *poly;
        if( lwgeom_is_empty((LWGEOM*)curvepoly) )
                return 0.0;
-       poly = lwcurvepoly_segmentize(curvepoly, 32);
+       poly = lwcurvepoly_stroke(curvepoly, 32);
        area = lwpoly_area(poly);
        lwpoly_free(poly);
        return area;
index f0db4f4bc0a3100e1efef7fc4b4dd40437bf17cc..29bba019b9dc771de71ac7e1f9c3f4474ed055f4 100644 (file)
@@ -758,7 +758,7 @@ lwgeom_force_sfs(LWGEOM *geom, int version)
                        case CURVEPOLYTYPE:
                        case MULTICURVETYPE:
                        case MULTISURFACETYPE:
-                               return lwgeom_segmentize(geom, 32);
+                               return lwgeom_stroke(geom, 32);
 
                        case COLLECTIONTYPE:
                                col = (LWCOLLECTION*)geom;
@@ -782,7 +782,7 @@ lwgeom_force_sfs(LWGEOM *geom, int version)
                case CURVEPOLYTYPE:
                case MULTICURVETYPE:
                case MULTISURFACETYPE:
-                       return lwgeom_segmentize(geom, 32);
+                       return lwgeom_stroke(geom, 32);
 
                /* SFS 1.2 types */
                case TRIANGLETYPE:
similarity index 82%
rename from liblwgeom/lwsegmentize.c
rename to liblwgeom/lwstroke.c
index 12b5668adee6f32d8133209e95c737de46ec7f62..04d19cf94ba24a8974aa14a815d210b348a02d08 100644 (file)
 #include "lwgeom_log.h"
 
 
-LWMLINE *lwmcurve_segmentize(LWMCURVE *mcurve, uint32_t perQuad);
-LWMPOLY *lwmsurface_segmentize(LWMSURFACE *msurface, uint32_t perQuad);
-LWCOLLECTION *lwcollection_segmentize(LWCOLLECTION *collection, uint32_t perQuad);
+LWMLINE *lwmcurve_stroke(LWMCURVE *mcurve, uint32_t perQuad);
+LWMPOLY *lwmsurface_stroke(LWMSURFACE *msurface, uint32_t perQuad);
+LWCOLLECTION *lwcollection_stroke(LWCOLLECTION *collection, uint32_t perQuad);
 
-LWGEOM *pta_desegmentize(POINTARRAY *points, int type, int srid);
-LWGEOM *lwline_desegmentize(LWLINE *line);
-LWGEOM *lwpolygon_desegmentize(LWPOLY *poly);
-LWGEOM *lwmline_desegmentize(LWMLINE *mline);
-LWGEOM *lwmpolygon_desegmentize(LWMPOLY *mpoly);
-LWGEOM *lwgeom_desegmentize(LWGEOM *geom);
+LWGEOM *pta_unstroke(POINTARRAY *points, int type, int srid);
+LWGEOM *lwline_unstroke(LWLINE *line);
+LWGEOM *lwpolygon_unstroke(LWPOLY *poly);
+LWGEOM *lwmline_unstroke(LWMLINE *mline);
+LWGEOM *lwmpolygon_unstroke(LWMPOLY *mpoly);
+LWGEOM *lwgeom_unstroke(LWGEOM *geom);
 
 
 /*
@@ -99,7 +99,7 @@ static double interpolate_arc(double angle, double a1, double a2, double a3, dou
 }
 
 static POINTARRAY *
-lwcircle_segmentize(POINT4D *p1, POINT4D *p2, POINT4D *p3, uint32_t perQuad)
+lwcircle_stroke(POINT4D *p1, POINT4D *p2, POINT4D *p3, uint32_t perQuad)
 {
        POINT2D center;
        POINT2D *t1 = (POINT2D*)p1;
@@ -187,7 +187,7 @@ lwcircle_segmentize(POINT4D *p1, POINT4D *p2, POINT4D *p3, uint32_t perQuad)
 }
 
 LWLINE *
-lwcircstring_segmentize(const LWCIRCSTRING *icurve, uint32_t perQuad)
+lwcircstring_stroke(const LWCIRCSTRING *icurve, uint32_t perQuad)
 {
        LWLINE *oline;
        POINTARRAY *ptarray;
@@ -195,22 +195,22 @@ lwcircstring_segmentize(const LWCIRCSTRING *icurve, uint32_t perQuad)
        uint32_t i, j;
        POINT4D p1, p2, p3, p4;
 
-       LWDEBUGF(2, "lwcircstring_segmentize called., dim = %d", icurve->points->flags);
+       LWDEBUGF(2, "lwcircstring_stroke called., dim = %d", icurve->points->flags);
 
        ptarray = ptarray_construct_empty(FLAGS_GET_Z(icurve->points->flags), FLAGS_GET_M(icurve->points->flags), 64);
 
        for (i = 2; i < icurve->points->npoints; i+=2)
        {
-               LWDEBUGF(3, "lwcircstring_segmentize: arc ending at point %d", i);
+               LWDEBUGF(3, "lwcircstring_stroke: arc ending at point %d", i);
 
                getPoint4d_p(icurve->points, i - 2, &p1);
                getPoint4d_p(icurve->points, i - 1, &p2);
                getPoint4d_p(icurve->points, i, &p3);
-               tmp = lwcircle_segmentize(&p1, &p2, &p3, perQuad);
+               tmp = lwcircle_stroke(&p1, &p2, &p3, perQuad);
 
                if (tmp)
                {
-                       LWDEBUGF(3, "lwcircstring_segmentize: generated %d points", tmp->npoints);
+                       LWDEBUGF(3, "lwcircstring_stroke: generated %d points", tmp->npoints);
 
                        for (j = 0; j < tmp->npoints; j++)
                        {
@@ -221,7 +221,7 @@ lwcircstring_segmentize(const LWCIRCSTRING *icurve, uint32_t perQuad)
                }
                else
                {
-                       LWDEBUG(3, "lwcircstring_segmentize: points are colinear, returning curve points as line");
+                       LWDEBUG(3, "lwcircstring_stroke: points are colinear, returning curve points as line");
 
                        for (j = i - 2 ; j < i ; j++)
                        {
@@ -239,7 +239,7 @@ lwcircstring_segmentize(const LWCIRCSTRING *icurve, uint32_t perQuad)
 }
 
 LWLINE *
-lwcompound_segmentize(const LWCOMPOUND *icompound, uint32_t perQuad)
+lwcompound_stroke(const LWCOMPOUND *icompound, uint32_t perQuad)
 {
        LWGEOM *geom;
        POINTARRAY *ptarray = NULL, *ptarray_out = NULL;
@@ -247,7 +247,7 @@ lwcompound_segmentize(const LWCOMPOUND *icompound, uint32_t perQuad)
        uint32_t i, j;
        POINT4D p;
 
-       LWDEBUG(2, "lwcompound_segmentize called.");
+       LWDEBUG(2, "lwcompound_stroke called.");
 
        ptarray = ptarray_construct_empty(FLAGS_GET_Z(icompound->flags), FLAGS_GET_M(icompound->flags), 64);
 
@@ -256,7 +256,7 @@ lwcompound_segmentize(const LWCOMPOUND *icompound, uint32_t perQuad)
                geom = icompound->geoms[i];
                if (geom->type == CIRCSTRINGTYPE)
                {
-                       tmp = lwcircstring_segmentize((LWCIRCSTRING *)geom, perQuad);
+                       tmp = lwcircstring_stroke((LWCIRCSTRING *)geom, perQuad);
                        for (j = 0; j < tmp->points->npoints; j++)
                        {
                                getPoint4d_p(tmp->points, j, &p);
@@ -286,7 +286,7 @@ lwcompound_segmentize(const LWCOMPOUND *icompound, uint32_t perQuad)
 }
 
 LWPOLY *
-lwcurvepoly_segmentize(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
+lwcurvepoly_stroke(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
 {
        LWPOLY *ogeom;
        LWGEOM *tmp;
@@ -294,7 +294,7 @@ lwcurvepoly_segmentize(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
        POINTARRAY **ptarray;
        int i;
 
-       LWDEBUG(2, "lwcurvepoly_segmentize called.");
+       LWDEBUG(2, "lwcurvepoly_stroke called.");
 
        ptarray = lwalloc(sizeof(POINTARRAY *)*curvepoly->nrings);
 
@@ -303,7 +303,7 @@ lwcurvepoly_segmentize(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
                tmp = curvepoly->rings[i];
                if (tmp->type == CIRCSTRINGTYPE)
                {
-                       line = lwcircstring_segmentize((LWCIRCSTRING *)tmp, perQuad);
+                       line = lwcircstring_stroke((LWCIRCSTRING *)tmp, perQuad);
                        ptarray[i] = ptarray_clone_deep(line->points);
                        lwline_free(line);
                }
@@ -314,7 +314,7 @@ lwcurvepoly_segmentize(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
                }
                else if (tmp->type == COMPOUNDTYPE)
                {
-                       line = lwcompound_segmentize((LWCOMPOUND *)tmp, perQuad);
+                       line = lwcompound_stroke((LWCOMPOUND *)tmp, perQuad);
                        ptarray[i] = ptarray_clone_deep(line->points);
                        lwline_free(line);
                }
@@ -330,14 +330,14 @@ lwcurvepoly_segmentize(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
 }
 
 LWMLINE *
-lwmcurve_segmentize(LWMCURVE *mcurve, uint32_t perQuad)
+lwmcurve_stroke(LWMCURVE *mcurve, uint32_t perQuad)
 {
        LWMLINE *ogeom;
        LWGEOM *tmp;
        LWGEOM **lines;
        int i;
 
-       LWDEBUGF(2, "lwmcurve_segmentize called, geoms=%d, dim=%d.", mcurve->ngeoms, FLAGS_NDIMS(mcurve->flags));
+       LWDEBUGF(2, "lwmcurve_stroke called, geoms=%d, dim=%d.", mcurve->ngeoms, FLAGS_NDIMS(mcurve->flags));
 
        lines = lwalloc(sizeof(LWGEOM *)*mcurve->ngeoms);
 
@@ -346,7 +346,7 @@ lwmcurve_segmentize(LWMCURVE *mcurve, uint32_t perQuad)
                tmp = mcurve->geoms[i];
                if (tmp->type == CIRCSTRINGTYPE)
                {
-                       lines[i] = (LWGEOM *)lwcircstring_segmentize((LWCIRCSTRING *)tmp, perQuad);
+                       lines[i] = (LWGEOM *)lwcircstring_stroke((LWCIRCSTRING *)tmp, perQuad);
                }
                else if (tmp->type == LINETYPE)
                {
@@ -354,7 +354,7 @@ lwmcurve_segmentize(LWMCURVE *mcurve, uint32_t perQuad)
                }
                else if (tmp->type == COMPOUNDTYPE)
                {
-                       lines[i] = (LWGEOM *)lwcompound_segmentize((LWCOMPOUND *)tmp, perQuad);
+                       lines[i] = (LWGEOM *)lwcompound_stroke((LWCOMPOUND *)tmp, perQuad);
                }
                else
                {
@@ -368,7 +368,7 @@ lwmcurve_segmentize(LWMCURVE *mcurve, uint32_t perQuad)
 }
 
 LWMPOLY *
-lwmsurface_segmentize(LWMSURFACE *msurface, uint32_t perQuad)
+lwmsurface_stroke(LWMSURFACE *msurface, uint32_t perQuad)
 {
        LWMPOLY *ogeom;
        LWGEOM *tmp;
@@ -377,7 +377,7 @@ lwmsurface_segmentize(LWMSURFACE *msurface, uint32_t perQuad)
        POINTARRAY **ptarray;
        int i, j;
 
-       LWDEBUG(2, "lwmsurface_segmentize called.");
+       LWDEBUG(2, "lwmsurface_stroke called.");
 
        polys = lwalloc(sizeof(LWGEOM *)*msurface->ngeoms);
 
@@ -386,7 +386,7 @@ lwmsurface_segmentize(LWMSURFACE *msurface, uint32_t perQuad)
                tmp = msurface->geoms[i];
                if (tmp->type == CURVEPOLYTYPE)
                {
-                       polys[i] = (LWGEOM *)lwcurvepoly_segmentize((LWCURVEPOLY *)tmp, perQuad);
+                       polys[i] = (LWGEOM *)lwcurvepoly_stroke((LWCURVEPOLY *)tmp, perQuad);
                }
                else if (tmp->type == POLYGONTYPE)
                {
@@ -404,14 +404,14 @@ lwmsurface_segmentize(LWMSURFACE *msurface, uint32_t perQuad)
 }
 
 LWCOLLECTION *
-lwcollection_segmentize(LWCOLLECTION *collection, uint32_t perQuad)
+lwcollection_stroke(LWCOLLECTION *collection, uint32_t perQuad)
 {
        LWCOLLECTION *ocol;
        LWGEOM *tmp;
        LWGEOM **geoms;
        int i;
 
-       LWDEBUG(2, "lwcollection_segmentize called.");
+       LWDEBUG(2, "lwcollection_stroke called.");
 
        geoms = lwalloc(sizeof(LWGEOM *)*collection->ngeoms);
 
@@ -421,16 +421,16 @@ lwcollection_segmentize(LWCOLLECTION *collection, uint32_t perQuad)
                switch (tmp->type)
                {
                case CIRCSTRINGTYPE:
-                       geoms[i] = (LWGEOM *)lwcircstring_segmentize((LWCIRCSTRING *)tmp, perQuad);
+                       geoms[i] = (LWGEOM *)lwcircstring_stroke((LWCIRCSTRING *)tmp, perQuad);
                        break;
                case COMPOUNDTYPE:
-                       geoms[i] = (LWGEOM *)lwcompound_segmentize((LWCOMPOUND *)tmp, perQuad);
+                       geoms[i] = (LWGEOM *)lwcompound_stroke((LWCOMPOUND *)tmp, perQuad);
                        break;
                case CURVEPOLYTYPE:
-                       geoms[i] = (LWGEOM *)lwcurvepoly_segmentize((LWCURVEPOLY *)tmp, perQuad);
+                       geoms[i] = (LWGEOM *)lwcurvepoly_stroke((LWCURVEPOLY *)tmp, perQuad);
                        break;
                case COLLECTIONTYPE:
-                       geoms[i] = (LWGEOM *)lwcollection_segmentize((LWCOLLECTION *)tmp, perQuad);
+                       geoms[i] = (LWGEOM *)lwcollection_stroke((LWCOLLECTION *)tmp, perQuad);
                        break;
                default:
                        geoms[i] = lwgeom_clone(tmp);
@@ -442,28 +442,28 @@ lwcollection_segmentize(LWCOLLECTION *collection, uint32_t perQuad)
 }
 
 LWGEOM *
-lwgeom_segmentize(LWGEOM *geom, uint32_t perQuad)
+lwgeom_stroke(LWGEOM *geom, uint32_t perQuad)
 {
        LWGEOM * ogeom = NULL;
        switch (geom->type)
        {
        case CIRCSTRINGTYPE:
-               ogeom = (LWGEOM *)lwcircstring_segmentize((LWCIRCSTRING *)geom, perQuad);
+               ogeom = (LWGEOM *)lwcircstring_stroke((LWCIRCSTRING *)geom, perQuad);
                break;
        case COMPOUNDTYPE:
-               ogeom = (LWGEOM *)lwcompound_segmentize((LWCOMPOUND *)geom, perQuad);
+               ogeom = (LWGEOM *)lwcompound_stroke((LWCOMPOUND *)geom, perQuad);
                break;
        case CURVEPOLYTYPE:
-               ogeom = (LWGEOM *)lwcurvepoly_segmentize((LWCURVEPOLY *)geom, perQuad);
+               ogeom = (LWGEOM *)lwcurvepoly_stroke((LWCURVEPOLY *)geom, perQuad);
                break;
        case MULTICURVETYPE:
-               ogeom = (LWGEOM *)lwmcurve_segmentize((LWMCURVE *)geom, perQuad);
+               ogeom = (LWGEOM *)lwmcurve_stroke((LWMCURVE *)geom, perQuad);
                break;
        case MULTISURFACETYPE:
-               ogeom = (LWGEOM *)lwmsurface_segmentize((LWMSURFACE *)geom, perQuad);
+               ogeom = (LWGEOM *)lwmsurface_stroke((LWMSURFACE *)geom, perQuad);
                break;
        case COLLECTIONTYPE:
-               ogeom = (LWGEOM *)lwcollection_segmentize((LWCOLLECTION *)geom, perQuad);
+               ogeom = (LWGEOM *)lwcollection_stroke((LWCOLLECTION *)geom, perQuad);
                break;
        default:
                ogeom = lwgeom_clone(geom);
@@ -582,7 +582,7 @@ geom_from_pa(const POINTARRAY *pa, int srid, int is_arc, int start, int end)
 }
 
 LWGEOM*
-pta_desegmentize(POINTARRAY *points, int type, int srid)
+pta_unstroke(POINTARRAY *points, int type, int srid)
 {
        int i = 0, j, k;
        POINT4D a1, a2, a3, b;
@@ -599,7 +599,7 @@ pta_desegmentize(POINTARRAY *points, int type, int srid)
 
        /* Die on null input */
        if ( ! points )
-               lwerror("pta_desegmentize called with null pointarray");
+               lwerror("pta_unstroke called with null pointarray");
 
        /* Null on empty input? */
        if ( points->npoints == 0 )
@@ -609,7 +609,7 @@ pta_desegmentize(POINTARRAY *points, int type, int srid)
        if ( points->npoints < 4 )
        {
                /* Return a linestring here*/
-               lwerror("pta_desegmentize needs implementation for npoints < 4");
+               lwerror("pta_unstroke needs implementation for npoints < 4");
        }
        
        /* Allocate our result array of vertices that are part of arcs */
@@ -744,26 +744,26 @@ pta_desegmentize(POINTARRAY *points, int type, int srid)
 
 
 LWGEOM *
-lwline_desegmentize(LWLINE *line)
+lwline_unstroke(LWLINE *line)
 {
-       LWDEBUG(2, "lwline_desegmentize called.");
+       LWDEBUG(2, "lwline_unstroke called.");
 
        if ( line->points->npoints < 4 ) return lwline_as_lwgeom(lwline_clone(line));
-       else return pta_desegmentize(line->points, line->flags, line->srid);
+       else return pta_unstroke(line->points, line->flags, line->srid);
 }
 
 LWGEOM *
-lwpolygon_desegmentize(LWPOLY *poly)
+lwpolygon_unstroke(LWPOLY *poly)
 {
        LWGEOM **geoms;
        int i, hascurve = 0;
 
-       LWDEBUG(2, "lwpolygon_desegmentize called.");
+       LWDEBUG(2, "lwpolygon_unstroke called.");
 
        geoms = lwalloc(sizeof(LWGEOM *)*poly->nrings);
        for (i=0; i<poly->nrings; i++)
        {
-               geoms[i] = pta_desegmentize(poly->rings[i], poly->flags, poly->srid);
+               geoms[i] = pta_unstroke(poly->rings[i], poly->flags, poly->srid);
                if (geoms[i]->type == CIRCSTRINGTYPE || geoms[i]->type == COMPOUNDTYPE)
                {
                        hascurve = 1;
@@ -782,17 +782,17 @@ lwpolygon_desegmentize(LWPOLY *poly)
 }
 
 LWGEOM *
-lwmline_desegmentize(LWMLINE *mline)
+lwmline_unstroke(LWMLINE *mline)
 {
        LWGEOM **geoms;
        int i, hascurve = 0;
 
-       LWDEBUG(2, "lwmline_desegmentize called.");
+       LWDEBUG(2, "lwmline_unstroke called.");
 
        geoms = lwalloc(sizeof(LWGEOM *)*mline->ngeoms);
        for (i=0; i<mline->ngeoms; i++)
        {
-               geoms[i] = lwline_desegmentize((LWLINE *)mline->geoms[i]);
+               geoms[i] = lwline_unstroke((LWLINE *)mline->geoms[i]);
                if (geoms[i]->type == CIRCSTRINGTYPE || geoms[i]->type == COMPOUNDTYPE)
                {
                        hascurve = 1;
@@ -810,17 +810,17 @@ lwmline_desegmentize(LWMLINE *mline)
 }
 
 LWGEOM *
-lwmpolygon_desegmentize(LWMPOLY *mpoly)
+lwmpolygon_unstroke(LWMPOLY *mpoly)
 {
        LWGEOM **geoms;
        int i, hascurve = 0;
 
-       LWDEBUG(2, "lwmpoly_desegmentize called.");
+       LWDEBUG(2, "lwmpoly_unstroke called.");
 
        geoms = lwalloc(sizeof(LWGEOM *)*mpoly->ngeoms);
        for (i=0; i<mpoly->ngeoms; i++)
        {
-               geoms[i] = lwpolygon_desegmentize((LWPOLY *)mpoly->geoms[i]);
+               geoms[i] = lwpolygon_unstroke((LWPOLY *)mpoly->geoms[i]);
                if (geoms[i]->type == CURVEPOLYTYPE)
                {
                        hascurve = 1;
@@ -838,20 +838,20 @@ lwmpolygon_desegmentize(LWMPOLY *mpoly)
 }
 
 LWGEOM *
-lwgeom_desegmentize(LWGEOM *geom)
+lwgeom_unstroke(LWGEOM *geom)
 {
-       LWDEBUG(2, "lwgeom_desegmentize called.");
+       LWDEBUG(2, "lwgeom_unstroke called.");
 
        switch (geom->type)
        {
        case LINETYPE:
-               return lwline_desegmentize((LWLINE *)geom);
+               return lwline_unstroke((LWLINE *)geom);
        case POLYGONTYPE:
-               return lwpolygon_desegmentize((LWPOLY *)geom);
+               return lwpolygon_unstroke((LWPOLY *)geom);
        case MULTILINETYPE:
-               return lwmline_desegmentize((LWMLINE *)geom);
+               return lwmline_unstroke((LWMLINE *)geom);
        case MULTIPOLYGONTYPE:
-               return lwmpolygon_desegmentize((LWMPOLY *)geom);
+               return lwmpolygon_unstroke((LWMPOLY *)geom);
        default:
                return lwgeom_clone(geom);
        }
index 7ca8934c79ba5f7ff00bf4984b4068604a9a2023..af592497604f7be240f333f30f6e0c2a49e3ae46 100644 (file)
@@ -68,7 +68,7 @@ Datum LWGEOM_curve_segmentize(PG_FUNCTION_ARGS)
        POSTGIS_DEBUGF(3, "perQuad = %d", perQuad);
 
        igeom = lwgeom_from_gserialized(geom);
-       ogeom = lwgeom_segmentize(igeom, perQuad);
+       ogeom = lwgeom_stroke(igeom, perQuad);
        lwgeom_free(igeom);
        
        if (ogeom == NULL) 
@@ -90,7 +90,7 @@ Datum LWGEOM_line_desegmentize(PG_FUNCTION_ARGS)
        POSTGIS_DEBUG(2, "LWGEOM_line_desegmentize.");
 
        igeom = lwgeom_from_gserialized(geom);
-       ogeom = lwgeom_desegmentize(igeom);
+       ogeom = lwgeom_unstroke(igeom);
        lwgeom_free(igeom);
 
        if (ogeom == NULL)