From cb6ae71bc4d669dd53f8796b98d9643710e79194 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Mon, 16 Jan 2012 22:26:45 +0000 Subject: [PATCH] Rename lwpoint_interpolate to point_interpolate git-svn-id: http://svn.osgeo.org/postgis/trunk@8851 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/installation.xml | 2 +- liblwgeom/cunit/cu_algorithm.c | 12 ++++++------ liblwgeom/liblwgeom_internal.h | 2 +- liblwgeom/lwlinearreferencing.c | 16 ++++++++-------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/installation.xml b/doc/installation.xml index 62a740590..7f8e690da 100644 --- a/doc/installation.xml +++ b/doc/installation.xml @@ -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 diff --git a/liblwgeom/cunit/cu_algorithm.c b/liblwgeom/cunit/cu_algorithm.c index ad03d08e6..394661252 100644 --- a/liblwgeom/cunit/cu_algorithm.c +++ b/liblwgeom/cunit/cu_algorithm.c @@ -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), diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index d2017376a..26f533641 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -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); /** diff --git a/liblwgeom/lwlinearreferencing.c b/liblwgeom/lwlinearreferencing.c index e80b62875..bcb557615 100644 --- a/liblwgeom/lwlinearreferencing.c +++ b/liblwgeom/lwlinearreferencing.c @@ -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. */ -- 2.40.0