]> granicus.if.org Git - postgis/commitdiff
Rename lwpoint_interpolate to point_interpolate
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 16 Jan 2012 22:26:45 +0000 (22:26 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 16 Jan 2012 22:26:45 +0000 (22:26 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8851 b70326c6-7e19-0410-871a-916f4a2858ee

doc/installation.xml
liblwgeom/cunit/cu_algorithm.c
liblwgeom/liblwgeom_internal.h
liblwgeom/lwlinearreferencing.c

index 62a74059029a1c89dea6173421f6a16cf98a8622..7f8e690da24d5ab811098ed803d138de4f05b25f 100644 (file)
@@ -647,7 +647,7 @@ Suite: PostGIS Computational Geometry Suite
   Test: test_lwline_crossing_bugs ... passed
   Test: test_lwpoint_set_ordinate ... passed
   Test: test_lwpoint_get_ordinate ... passed
-  Test: test_lwpoint_interpolate ... passed
+  Test: test_point_interpolate ... passed
   Test: test_lwline_clip ... passed
   Test: test_lwline_clip_big ... passed
   Test: test_lwmline_clip ... passed
index ad03d08e64e705eb8fe637cb184d56a52d2f2c2f..394661252070df247415cc8ea172480c6a01f7e8 100644 (file)
@@ -409,7 +409,7 @@ static void test_lwpoint_get_ordinate(void)
 
 }
 
-static void test_lwpoint_interpolate(void)
+static void test_point_interpolate(void)
 {
        POINT4D p, q, r;
        int rv = 0;
@@ -424,16 +424,16 @@ static void test_lwpoint_interpolate(void)
        q.z = 40.0;
        q.m = 50.0;
 
-       rv = lwpoint_interpolate(&p, &q, &r, 1, 1, 'Z', 35.0);
+       rv = point_interpolate(&p, &q, &r, 1, 1, 'Z', 35.0);
        CU_ASSERT_EQUAL( r.x, 15.0);
 
-       rv = lwpoint_interpolate(&p, &q, &r, 1, 1, 'M', 41.0);
+       rv = point_interpolate(&p, &q, &r, 1, 1, 'M', 41.0);
        CU_ASSERT_EQUAL( r.y, 21.0);
 
-       rv = lwpoint_interpolate(&p, &q, &r, 1, 1, 'M', 50.0);
+       rv = point_interpolate(&p, &q, &r, 1, 1, 'M', 50.0);
        CU_ASSERT_EQUAL( r.y, 30.0);
 
-       rv = lwpoint_interpolate(&p, &q, &r, 1, 1, 'M', 40.0);
+       rv = point_interpolate(&p, &q, &r, 1, 1, 'M', 40.0);
        CU_ASSERT_EQUAL( r.y, 20.0);
 
 }
@@ -890,7 +890,7 @@ CU_TestInfo algorithms_tests[] =
        PG_TEST(test_lwline_crossing_bugs),
        PG_TEST(test_lwpoint_set_ordinate),
        PG_TEST(test_lwpoint_get_ordinate),
-       PG_TEST(test_lwpoint_interpolate),
+       PG_TEST(test_point_interpolate),
        PG_TEST(test_lwline_clip),
        PG_TEST(test_lwline_clip_big),
        PG_TEST(test_lwmline_clip),
index d2017376a3564b1e1537595fe486491c6fd00b8b..26f533641cf5e31ea37c5ab7fbca7990860813fb 100644 (file)
@@ -218,7 +218,7 @@ void lwpoint_set_ordinate(POINT4D *p, char ordinate, double value);
 /* 
 * Generate an interpolated coordinate p given an interpolation value and ordinate to apply it to
 */
-int lwpoint_interpolate(const POINT4D *p1, const POINT4D *p2, POINT4D *p, int hasz, int hasm, char ordinate, double interpolation_value);
+int point_interpolate(const POINT4D *p1, const POINT4D *p2, POINT4D *p, int hasz, int hasm, char ordinate, double interpolation_value);
 
 
 /**
index e80b6287552587ab9a3fd8ee3fd88c558ebc6b11..bcb55761526661deb2f4a2bf0ac08e6deeeacc2d 100644 (file)
@@ -294,7 +294,7 @@ void lwpoint_set_ordinate(POINT4D *p, char ordinate, double value)
 * generate a new point that is proportionally between the input points,
 * using the values in the provided dimension as the scaling factors.
 */
-int lwpoint_interpolate(const POINT4D *p1, const POINT4D *p2, POINT4D *p, int hasz, int hasm, char ordinate, double interpolation_value)
+int point_interpolate(const POINT4D *p1, const POINT4D *p2, POINT4D *p, int hasz, int hasm, char ordinate, double interpolation_value)
 {
        static char* dims = "XYZM";
        double p1_value = lwpoint_get_ordinate(p1, ordinate);
@@ -605,7 +605,7 @@ lwline_clip_to_ordinate_range(const LWLINE *line, char ordinate, double from, do
                                {
                                        double interpolation_value;
                                        (ordinate_value_q > to) ? (interpolation_value = to) : (interpolation_value = from);
-                                       rv = lwpoint_interpolate(q, p, r, hasz, hasm, ordinate, interpolation_value);
+                                       rv = point_interpolate(q, p, r, hasz, hasm, ordinate, interpolation_value);
                                        rv = ptarray_append_point(dp, r, LW_FALSE);
                                        LWDEBUGF(4, "[0] interpolating between (%g, %g) with interpolation point (%g)", ordinate_value_q, ordinate_value_p, interpolation_value);
                                }
@@ -631,7 +631,7 @@ lwline_clip_to_ordinate_range(const LWLINE *line, char ordinate, double from, do
                                *  to the point array at the range boundary. */
                                double interpolation_value;
                                (ordinate_value_p > to) ? (interpolation_value = to) : (interpolation_value = from);
-                               rv = lwpoint_interpolate(q, p, r, hasz, hasm, ordinate, interpolation_value);
+                               rv = point_interpolate(q, p, r, hasz, hasm, ordinate, interpolation_value);
                                rv = ptarray_append_point(dp, r, LW_FALSE);
                                LWDEBUGF(4, " [1] interpolating between (%g, %g) with interpolation point (%g)", ordinate_value_q, ordinate_value_p, interpolation_value);
                        }
@@ -646,7 +646,7 @@ lwline_clip_to_ordinate_range(const LWLINE *line, char ordinate, double from, do
                                {
                                        double interpolation_value;
                                        (ordinate_value_p > to) ? (interpolation_value = to) : (interpolation_value = from);
-                                       rv = lwpoint_interpolate(q, p, r, hasz, hasm, ordinate, interpolation_value);
+                                       rv = point_interpolate(q, p, r, hasz, hasm, ordinate, interpolation_value);
                                        rv = ptarray_append_point(dp, r, LW_FALSE);
                                        LWDEBUGF(4, " [2] interpolating between (%g, %g) with interpolation point (%g)", ordinate_value_q, ordinate_value_p, interpolation_value);
                                }
@@ -657,10 +657,10 @@ lwline_clip_to_ordinate_range(const LWLINE *line, char ordinate, double from, do
                                *  so we need to add *two* interpolated points! */
                                dp = ptarray_construct(hasz, hasm, 2);
                                /* Interpolate lower point. */
-                               rv = lwpoint_interpolate(p, q, r, hasz, hasm, ordinate, from);
+                               rv = point_interpolate(p, q, r, hasz, hasm, ordinate, from);
                                ptarray_set_point4d(dp, 0, r);
                                /* Interpolate upper point. */
-                               rv = lwpoint_interpolate(p, q, r, hasz, hasm, ordinate, to);
+                               rv = point_interpolate(p, q, r, hasz, hasm, ordinate, to);
                                ptarray_set_point4d(dp, 1, r);
                        }
                        else if ( i && ordinate_value_q > to && ordinate_value_p < from )
@@ -669,10 +669,10 @@ lwline_clip_to_ordinate_range(const LWLINE *line, char ordinate, double from, do
                                *  so we need to add *two* interpolated points! */
                                dp = ptarray_construct(hasz, hasm, 2);
                                /* Interpolate upper point. */
-                               rv = lwpoint_interpolate(p, q, r, hasz, hasm, ordinate, to);
+                               rv = point_interpolate(p, q, r, hasz, hasm, ordinate, to);
                                ptarray_set_point4d(dp, 0, r);
                                /* Interpolate lower point. */
-                               rv = lwpoint_interpolate(p, q, r, hasz, hasm, ordinate, from);
+                               rv = point_interpolate(p, q, r, hasz, hasm, ordinate, from);
                                ptarray_set_point4d(dp, 1, r);
                        }
                        /* We have an extant point-array, save it out to a multi-line. */