From 14e5ca4b221a6d6a0dd5d69e675b84041eb97db0 Mon Sep 17 00:00:00 2001 From: abelvm Date: Tue, 16 Aug 2016 10:40:32 -0400 Subject: [PATCH 1/4] add full tests --- src/pg/test/expected/08_interpolation_test.out | 9 ++++++--- src/pg/test/sql/08_interpolation_test.sql | 8 +++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/pg/test/expected/08_interpolation_test.out b/src/pg/test/expected/08_interpolation_test.out index 42d24cb..c13a547 100644 --- a/src/pg/test/expected/08_interpolation_test.out +++ b/src/pg/test/expected/08_interpolation_test.out @@ -1,4 +1,7 @@ - cdb_spatialinterpolation --------------------------- - 780.79470198683925288365 +SET client_min_messages TO WARNING; +\set ECHO none + nn | nni | idw +-----+--------------------------+----------------- + 200 | 780.79470198683925288365 | 341.46260750526 (1 row) + diff --git a/src/pg/test/sql/08_interpolation_test.sql b/src/pg/test/sql/08_interpolation_test.sql index c8db89d..cb0d2e4 100644 --- a/src/pg/test/sql/08_interpolation_test.sql +++ b/src/pg/test/sql/08_interpolation_test.sql @@ -1,6 +1,12 @@ +SET client_min_messages TO WARNING; +\set ECHO none WITH a AS ( SELECT ARRAY[800, 700, 600, 500, 400, 300, 200, 100] AS vals, ARRAY[ST_GeomFromText('POINT(2.1744 41.403)'),ST_GeomFromText('POINT(2.1228 41.380)'),ST_GeomFromText('POINT(2.1511 41.374)'),ST_GeomFromText('POINT(2.1528 41.413)'),ST_GeomFromText('POINT(2.165 41.391)'),ST_GeomFromText('POINT(2.1498 41.371)'),ST_GeomFromText('POINT(2.1533 41.368)'),ST_GeomFromText('POINT(2.131386 41.41399)')] AS g ) -SELECT CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),1) FROM a; +SELECT + CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),0) as NN, + CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),1) as NNI, + CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),2) as IDW +FROM a; From 51b8da5bf853236126f336f08165a3818d4a8f11 Mon Sep 17 00:00:00 2001 From: abelvm Date: Tue, 16 Aug 2016 10:44:13 -0400 Subject: [PATCH 2/4] add full tests --- src/pg/test/expected/08_interpolation_test.out | 5 ----- src/pg/test/sql/08_interpolation_test.sql | 9 --------- 2 files changed, 14 deletions(-) diff --git a/src/pg/test/expected/08_interpolation_test.out b/src/pg/test/expected/08_interpolation_test.out index 29a9fed..c13a547 100644 --- a/src/pg/test/expected/08_interpolation_test.out +++ b/src/pg/test/expected/08_interpolation_test.out @@ -1,12 +1,7 @@ SET client_min_messages TO WARNING; \set ECHO none -<<<<<<< HEAD nn | nni | idw -----+--------------------------+----------------- 200 | 780.79470198683925288365 | 341.46260750526 -======= -cdb_spatialinterpolation -t ->>>>>>> ebbf68af5700f33737ac18516e2bdc22ea330b24 (1 row) diff --git a/src/pg/test/sql/08_interpolation_test.sql b/src/pg/test/sql/08_interpolation_test.sql index 89062f3..cb0d2e4 100644 --- a/src/pg/test/sql/08_interpolation_test.sql +++ b/src/pg/test/sql/08_interpolation_test.sql @@ -1,21 +1,12 @@ SET client_min_messages TO WARNING; \set ECHO none -<<<<<<< HEAD -======= -\pset format unaligned - ->>>>>>> ebbf68af5700f33737ac18516e2bdc22ea330b24 WITH a AS ( SELECT ARRAY[800, 700, 600, 500, 400, 300, 200, 100] AS vals, ARRAY[ST_GeomFromText('POINT(2.1744 41.403)'),ST_GeomFromText('POINT(2.1228 41.380)'),ST_GeomFromText('POINT(2.1511 41.374)'),ST_GeomFromText('POINT(2.1528 41.413)'),ST_GeomFromText('POINT(2.165 41.391)'),ST_GeomFromText('POINT(2.1498 41.371)'),ST_GeomFromText('POINT(2.1533 41.368)'),ST_GeomFromText('POINT(2.131386 41.41399)')] AS g ) -<<<<<<< HEAD SELECT CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),0) as NN, CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),1) as NNI, CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),2) as IDW FROM a; -======= -SELECT (cdb_crankshaft.CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'), 1) - 780.79470198683925288365) / 780.79470198683925288365 < 0.001 As cdb_spatialinterpolation FROM a; ->>>>>>> ebbf68af5700f33737ac18516e2bdc22ea330b24 From 5b8f7c4cd5e66c548b95127e168934583c52d2ab Mon Sep 17 00:00:00 2001 From: abelvm Date: Tue, 16 Aug 2016 11:01:25 -0400 Subject: [PATCH 3/4] add schema --- src/pg/test/sql/08_interpolation_test.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pg/test/sql/08_interpolation_test.sql b/src/pg/test/sql/08_interpolation_test.sql index cb0d2e4..c45184f 100644 --- a/src/pg/test/sql/08_interpolation_test.sql +++ b/src/pg/test/sql/08_interpolation_test.sql @@ -6,7 +6,7 @@ WITH a AS ( ARRAY[ST_GeomFromText('POINT(2.1744 41.403)'),ST_GeomFromText('POINT(2.1228 41.380)'),ST_GeomFromText('POINT(2.1511 41.374)'),ST_GeomFromText('POINT(2.1528 41.413)'),ST_GeomFromText('POINT(2.165 41.391)'),ST_GeomFromText('POINT(2.1498 41.371)'),ST_GeomFromText('POINT(2.1533 41.368)'),ST_GeomFromText('POINT(2.131386 41.41399)')] AS g ) SELECT - CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),0) as NN, - CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),1) as NNI, - CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),2) as IDW + cdb_crankshaft.CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),0) as NN, + cdb_crankshaft.CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),1) as NNI, + cdb_crankshaft.CDB_SpatialInterpolation(g, vals, ST_GeomFromText('POINT(2.154 41.37)'),2) as IDW FROM a; From 756db707b59a3dff445646918cb04b7867a79076 Mon Sep 17 00:00:00 2001 From: abelvm Date: Tue, 16 Aug 2016 11:08:17 -0400 Subject: [PATCH 4/4] fix results --- src/pg/test/expected/08_interpolation_test.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pg/test/expected/08_interpolation_test.out b/src/pg/test/expected/08_interpolation_test.out index c13a547..1e4502a 100644 --- a/src/pg/test/expected/08_interpolation_test.out +++ b/src/pg/test/expected/08_interpolation_test.out @@ -2,6 +2,6 @@ SET client_min_messages TO WARNING; \set ECHO none nn | nni | idw -----+--------------------------+----------------- - 200 | 780.79470198683925288365 | 341.46260750526 + 200 | 238.41059602632179224595 | 341.46260750526 (1 row)