Commit a535f159 authored by Regina Obe's avatar Regina Obe

Put in rounding to fix regression as result of changes in PostgreSQL 12

References #4329 for PostGIS 3.0

git-svn-id: http://svn.osgeo.org/postgis/trunk@17262 b70326c6-7e19-0410-871a-916f4a2858ee
parent 2ad465db
Pipeline #48293335 failed with stage
in 7 minutes and 35 seconds
......@@ -9,7 +9,7 @@ SELECT 'frechet_ls_ls', st_frechetdistance(
-- other linestrings
SELECT 'frechet_ls_ls_2', st_frechetdistance(
'LINESTRING (0 0, 2 0)'::geometry,
'LINESTRING (0 1, 1 2, 2 1)'::geometry);
'LINESTRING (0 1, 1 2, 2 1)'::geometry)::numeric(12,6);
-- 2.23606797749979
-- linestring and multipoint
......@@ -21,7 +21,7 @@ SELECT 'frechet_ls_mp', st_frechetdistance(
-- another linestring and linestring
SELECT 'frechet_ls_ls_3', st_frechetdistance(
'LINESTRING (0 0, 100 0)'::geometry,
'LINESTRING (0 0, 50 50, 100 0)'::geometry);
'LINESTRING (0 0, 50 50, 100 0)'::geometry)::numeric(12,6);
-- 70.7106781186548
-- rechet with densification
......
frechet_ls_ls|1
frechet_ls_ls_2|2.23606797749979
frechet_ls_ls_2|2.236068
frechet_ls_mp|1
frechet_ls_ls_3|70.7106781186548
frechet_ls_ls_3|70.710678
frechetdensify_ls_ls|50
......@@ -3,7 +3,7 @@
-- polygon and polygon
SELECT 'hausdorff_poly_poly', st_hausdorffdistance(
'POLYGON((0 0, 0 2, 1 2, 2 2, 2 0, 0 0))'::geometry,
'POLYGON((0.5 0.5, 0.5 2.5, 1.5 2.5, 2.5 2.5, 2.5 0.5, 0.5 0.5))'::geometry);
'POLYGON((0.5 0.5, 0.5 2.5, 1.5 2.5, 2.5 2.5, 2.5 0.5, 0.5 0.5))'::geometry)::numeric(12,5);
-- 0.707106781186548
-- linestring and linestring
......@@ -27,7 +27,7 @@ SELECT 'hausdorff_ls_mp', st_hausdorffdistance(
-- another linestring and linestring
SELECT 'hausdorff_ls_ls_3', st_hausdorffdistance(
'LINESTRING (130 0, 0 0, 0 150)'::geometry,
'LINESTRING (10 10, 10 150, 130 10)'::geometry);
'LINESTRING (10 10, 10 150, 130 10)'::geometry)::numeric(12,5);
-- 14.142135623730951
-- hausdorf with densification
......
hausdorff_poly_poly|0.707106781186548
hausdorff_poly_poly|0.70711
hausdorff_ls_ls|1
hausdorff_ls_ls_2|2
hausdorff_ls_mp|1
hausdorff_ls_ls_3|14.142135623731
hausdorff_ls_ls_3|14.14214
hausdorffdensify_ls_ls|70
......@@ -231,7 +231,7 @@ INSERT INTO test_wo VALUES
CREATE INDEX ON TEST_WO USING GIST (GEO);
analyze test_wo;
SET enable_seqscan = false;
SELECT '#3418' As ticket, '0101000020E610000092054CE0D6DDE5BFCDCCCCCCCCAC4A40'::geometry <-> geo, ST_Distance('0101000020E610000092054CE0D6DDE5BFCDCCCCCCCCAC4A40'::geometry, geo)
SELECT '#3418' As ticket, ('0101000020E610000092054CE0D6DDE5BFCDCCCCCCCCAC4A40'::geometry <-> geo)::numeric(14,7), ST_Distance('0101000020E610000092054CE0D6DDE5BFCDCCCCCCCCAC4A40'::geometry, geo)::numeric(14,7)
FROM test_wo ORDER BY geo <->
('0101000020E610000092054CE0D6DDE5BFCDCCCCCCCCAC4A40'::geometry);
DROP TABLE test_wo;
......
......@@ -103,5 +103,5 @@
#3nd-3|600001|9749|54.5453|54.5453
#3nd-3|600001|10041|54.6233|54.6233
#3573|8
#3418|0.331823813642119|0.331823813642119
#3418|0.55|0.55
#3418|0.3318238|0.3318238
#3418|0.5500000|0.5500000
......@@ -153,13 +153,13 @@ SELECT 'ST_Azimuth_null_geom' , ST_Azimuth(geom1,geom2)
FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('EMPTY') AS geom2;
--- ST_Angle(points)
SELECT 'ST_Angle_4_pts', St_Angle(p1,p2,p3,p4)
SELECT 'ST_Angle_4_pts', St_Angle(p1,p2,p3,p4)::numeric(12,6)
FROM ST_GeomFromtext('POINT(0 1)') AS p1, ST_GeomFromtext('POINT(0 0)') AS p2
, ST_GeomFromtext('POINT(1 0)') AS p3, ST_GeomFromtext('POINT(2 0)') AS p4;
SELECT 'ST_Angle_4_pts', St_Angle(p1,p2,p3,p4)
SELECT 'ST_Angle_4_pts', St_Angle(p1,p2,p3,p4)::numeric(12,6)
FROM ST_GeomFromtext('POINT(2 0)') AS p1, ST_GeomFromtext('POINT(1 0)') AS p2
, ST_GeomFromtext('POINT(1 -1)') AS p3, ST_GeomFromtext('POINT(0 0)') AS p4;
SELECT 'ST_Angle_3_pts', St_Angle(p1,p2,p3)
SELECT 'ST_Angle_3_pts', St_Angle(p1,p2,p3)::numeric(12,6)
FROM ST_GeomFromtext('POINT(0 1)') AS p1, ST_GeomFromtext('POINT(0 0)') AS p2
, ST_GeomFromtext('POINT(1 0)') AS p3, ST_GeomFromtext('POINT(2 0)') AS p4;
SELECT 'ST_Angle_mixed_srid', St_Angle(p1,p2,p3,p4)
......@@ -169,7 +169,7 @@ SELECT 'ST_Angle_empty' , St_Angle(p1,p2,p3,p4)
FROM ST_GeomFromtext('POINT EMPTY') AS p1, ST_GeomFromtext('POINT(0 0)') AS p2
, ST_GeomFromtext('POINT(1 0)',4326) AS p3, ST_GeomFromtext('POINT(2 0)') AS p4;
--- ST_Angle(lines)
SELECT 'ST_Angle_2_lines', St_Angle(l1,l2)
SELECT 'ST_Angle_2_lines', St_Angle(l1,l2)::numeric(12,6)
FROM ST_GeomFromtext('LINESTRING(0 1,0 0)') AS l1
, ST_GeomFromtext('LINESTRING(1 0, 2 0)') AS l2;
......
......@@ -27,12 +27,12 @@ ST_Azimuth_same_point|
ERROR: Operation on mixed SRID geometries
ERROR: Argument must be POINT geometries
ERROR: parse error - invalid geometry
ST_Angle_4_pts|4.71238898038469
ST_Angle_4_pts|0.785398163397448
ST_Angle_3_pts|1.5707963267949
ST_Angle_4_pts|4.712389
ST_Angle_4_pts|0.785398
ST_Angle_3_pts|1.570796
ERROR: Operation on mixed SRID geometries
ERROR: Empty geometry
ST_Angle_2_lines|4.71238898038469
ST_Angle_2_lines|4.712389
#3965|25|25
#3971|t
#4071|2|3|4
......
......@@ -5,9 +5,9 @@ select '114', ST_perimeter2d('MULTIPOLYGON( ((0 0, 10 0, 10 10, 0 10, 0 0)),( (0
select '115', ST_3DPerimeter('MULTIPOLYGON( ((0 0 0, 10 0 0, 10 10 0, 0 10 0, 0 0 0)),( (0 0 0, 10 0 0, 10 10 0, 0 10 0, 0 0 0),(5 5 0, 7 5 0, 7 7 0, 5 7 0, 5 5 0) ) ,( (0 0 1, 10 0 1, 10 10 1, 0 10 1, 0 0 1),(5 5 1, 7 5 1, 7 7 1, 5 7 1, 5 5 1),(1 1 1,2 1 1, 2 2 1, 1 2 1, 1 1 1) ) )'::GEOMETRY) as value;
select '116', ST_length2d('MULTILINESTRING((0 0, 1 1),(0 0, 1 1, 2 2) )'::GEOMETRY) as value;
select '117', ST_3dlength('MULTILINESTRING((0 0, 1 1),(0 0, 1 1, 2 2) )'::GEOMETRY) as value;
select '118', ST_3dlength('MULTILINESTRING((0 0 0, 1 1 1),(0 0 0, 1 1 1, 2 2 2) )'::GEOMETRY) as value;
select '116', ST_length2d('MULTILINESTRING((0 0, 1 1),(0 0, 1 1, 2 2) )'::GEOMETRY)::numeric(12,6) as value;
select '117', ST_3dlength('MULTILINESTRING((0 0, 1 1),(0 0, 1 1, 2 2) )'::GEOMETRY)::numeric(12,6) as value;
select '118', ST_3dlength('MULTILINESTRING((0 0 0, 1 1 1),(0 0 0, 1 1 1, 2 2 2) )'::GEOMETRY)::numeric(12,6) as value;
select '134', ST_Distance('POINT(1 2)', 'POINT(1 2)');
select '135', ST_Distance('POINT(5 0)', 'POINT(10 12)');
......@@ -47,7 +47,7 @@ select 'st_maxdistance_135', st_maxdistance('POINT(5 0)', 'POINT(10 12)');
select 'st_maxdistance_136', st_maxdistance('POINT(0 0)', ST_translate('POINT(0 0)', 5, 12, 0));
-- postgis-users/2006-May/012174.html
select 'st_maxdistance_dist', st_maxdistance(a,b), st_maxdistance(b,a) from (
select 'st_maxdistance_dist', st_maxdistance(a,b)::numeric(12,6), st_maxdistance(b,a)::numeric(12,6) from (
select 'POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))'::geometry as a,
'POLYGON((11 0, 11 10, 20 10, 20 0, 11 0),
(15 5, 15 8, 17 8, 17 5, 15 5))'::geometry as b
......@@ -118,7 +118,7 @@ select 'distancepoly2',
select 'distancepoly3',
ST_Distance(a, b),
st_maxdistance(a, b),
st_maxdistance(a, b)::numeric(12,6),
st_astext(st_shortestline(a,b)),
st_astext(st_shortestline(b,a)),
st_astext(st_longestline(a,b)),
......@@ -129,7 +129,7 @@ select 'distancepoly3',
select 'distancepoly4',
ST_Distance(a, b),
st_maxdistance(a, b),
st_maxdistance(a, b)::numeric(12,6),
st_astext(st_shortestline(a,b)),
st_astext(st_shortestline(b,a)),
st_astext(st_longestline(a,b)),
......@@ -140,7 +140,7 @@ select 'distancepoly4',
select 'distancepoly5',
ST_Distance(a, b),
st_maxdistance(a, b),
st_maxdistance(a, b)::numeric(12,6),
st_astext(st_shortestline(a,b)),
st_astext(st_shortestline(b,a)),
st_astext(st_longestline(a,b)),
......@@ -151,7 +151,7 @@ select 'distancepoly5',
select 'distancepoly6',
ST_Distance(a, b),
st_maxdistance(a, b),
st_maxdistance(a, b)::numeric(12,6),
st_astext(st_shortestline(a,b)),
st_astext(st_shortestline(b,a)),
st_astext(st_longestline(a,b)),
......@@ -163,8 +163,8 @@ select 'distancepoly6',
--3D Distance functions
SELECT '3dDistancetest1',
ST_3DDistance(a,b),
ST_3DMaxDistance(a,b),
ST_3DDistance(a,b)::numeric(12,6),
ST_3DMaxDistance(a,b)::numeric(12,6),
ST_3DDWithin(a,b,5),
ST_3DDFullyWithin(a,b,5),
ST_ASEWKT(ST_3DShortestline(a,b)),
......@@ -175,7 +175,7 @@ SELECT '3dDistancetest1',
SELECT '3dDistancetest2',
ST_3DDistance(a,b),
ST_3DMaxDistance(a,b),
ST_3DMaxDistance(a,b)::numeric(12,6),
ST_3DDWithin(a,b,5),
ST_3DDFullyWithin(a,b,5),
ST_ASEWKT(ST_3DShortestline(a,b)),
......@@ -185,8 +185,8 @@ SELECT '3dDistancetest2',
) as foo;
SELECT '3dDistancetest3',
ST_3DDistance(a,b),
ST_3DMaxDistance(a,b),
ST_3DDistance(a,b)::numeric(12,6),
ST_3DMaxDistance(a,b)::numeric(12,6),
ST_3DDWithin(a,b,5),
ST_3DDFullyWithin(a,b,5),
ST_ASEWKT(ST_SnapToGrid(ST_3DShortestline(a,b), 1e-14)),
......@@ -197,7 +197,7 @@ SELECT '3dDistancetest3',
SELECT '3dDistancetest4',
ST_3DDistance(a,b),
ST_3DMaxDistance(a,b),
ST_3DMaxDistance(a,b)::numeric(12,6),
ST_3DDWithin(a,b,5),
ST_3DDFullyWithin(a,b,5),
ST_ASEWKT(ST_3DShortestline(a,b)),
......
113|291
114|140
115|140
116|4.24264068711929
117|4.24264068711929
118|5.19615242270663
116|4.242641
117|4.242641
118|5.196152
134|0
135|13
136|13
......@@ -16,7 +16,7 @@ st_shortestline_dist|LINESTRING(10 0,11 0)|LINESTRING(11 0,10 0)
st_maxdistance_134|0
st_maxdistance_135|13
st_maxdistance_136|13
st_maxdistance_dist|22.3606797749979|22.3606797749979
st_maxdistance_dist|22.360680|22.360680
st_longestline_134|LINESTRING(1 2,1 2)
st_longestline_135|LINESTRING(5 0,10 12)
st_longestline_136|LINESTRING(0 0,5 12)
......@@ -24,15 +24,15 @@ st_longestline_dist|LINESTRING(0 0,20 10)|LINESTRING(20 10,0 0)
distancetest1|1|50|LINESTRING(17 18,17 19)|LINESTRING(17 19,17 18)|LINESTRING(29 39,-1 -1)|LINESTRING(-1 -1,29 39)
distancetest2|0|50|0.0000000000|0.0000000000|0.0000000000|0.0000000000|LINESTRING(-40 -20,-10 20)|LINESTRING(-10 20,-40 -20)
distancepoly1|1|50|LINESTRING(17 18,17 19)|LINESTRING(17 19,17 18)|LINESTRING(29 39,-1 -1)|LINESTRING(-1 -1,29 39)
distancepoly2|0|26.1725046566048|LINESTRING(17 14,17 14)|LINESTRING(17 14,17 14)|LINESTRING(17 18,-1 -1)|LINESTRING(-1 -1,17 18)
distancepoly3|0|26.9072480941474|LINESTRING(17 19,17 19)|LINESTRING(17 19,17 19)|LINESTRING(17 19,-1 -1)|LINESTRING(-1 -1,17 19)
distancepoly4|0|28.3196045170126|LINESTRING(16 19,16 19)|LINESTRING(16 19,16 19)|LINESTRING(18 20,-1 -1)|LINESTRING(-1 -1,18 20)
distancepoly5|0|26.1725046566048|LINESTRING(17 12,17 12)|LINESTRING(17 12,17 12)|LINESTRING(17 18,-1 -1)|LINESTRING(-1 -1,17 18)
distancepoly6|0|32.5269119345812|LINESTRING(2 2,2 2)|LINESTRING(2 2,2 2)|LINESTRING(2 2,25 25)|LINESTRING(25 25,2 2)
3dDistancetest1|6.40312423743285|6.40312423743285|f|f|LINESTRING(1 1 1,3 2 7)|POINT(1 1 1)|LINESTRING(1 1 1,3 2 7)
3dDistancetest2|0|1.73205080756888|t|t|LINESTRING(1 1 1,1 1 1)|POINT(1 1 1)|LINESTRING(1 1 1,0 0 0)
3dDistancetest3|4.09994192757944|6.48074069840786|t|f|LINESTRING(1 1 1,0.61904761904762 -0.19047619047619 4.90476190476191)|POINT(1 1 1)|LINESTRING(1 1 1,5 2 6)
3dDistancetest4|2|10.0498756211209|t|f|LINESTRING(1 1 3,1 1 1)|POINT(1 1 3)|LINESTRING(5 7 8,1 1 1)
distancepoly2|0|26.172505|LINESTRING(17 14,17 14)|LINESTRING(17 14,17 14)|LINESTRING(17 18,-1 -1)|LINESTRING(-1 -1,17 18)
distancepoly3|0|26.907248|LINESTRING(17 19,17 19)|LINESTRING(17 19,17 19)|LINESTRING(17 19,-1 -1)|LINESTRING(-1 -1,17 19)
distancepoly4|0|28.319605|LINESTRING(16 19,16 19)|LINESTRING(16 19,16 19)|LINESTRING(18 20,-1 -1)|LINESTRING(-1 -1,18 20)
distancepoly5|0|26.172505|LINESTRING(17 12,17 12)|LINESTRING(17 12,17 12)|LINESTRING(17 18,-1 -1)|LINESTRING(-1 -1,17 18)
distancepoly6|0|32.526912|LINESTRING(2 2,2 2)|LINESTRING(2 2,2 2)|LINESTRING(2 2,25 25)|LINESTRING(25 25,2 2)
3dDistancetest1|6.403124|6.403124|f|f|LINESTRING(1 1 1,3 2 7)|POINT(1 1 1)|LINESTRING(1 1 1,3 2 7)
3dDistancetest2|0|1.732051|t|t|LINESTRING(1 1 1,1 1 1)|POINT(1 1 1)|LINESTRING(1 1 1,0 0 0)
3dDistancetest3|4.099942|6.480741|t|f|LINESTRING(1 1 1,0.61904761904762 -0.19047619047619 4.90476190476191)|POINT(1 1 1)|LINESTRING(1 1 1,5 2 6)
3dDistancetest4|2|10.049876|t|f|LINESTRING(1 1 3,1 1 1)|POINT(1 1 3)|LINESTRING(5 7 8,1 1 1)
3dDistancetest5|2|10|t|f|LINESTRING(5 0 5,5 2 5)|POINT(5 0 5)|LINESTRING(11 0 5,5 0 13)
3dDistancetest6|0
3dDistancetest7|0
......
......@@ -35,7 +35,7 @@ select '#4155.3', ST_AsText(ST_LocateBetweenElevations('MULTIPOLYGON Z EMPTY', 2
--- line_locate_point
SELECT 'line_locate_point_1', ST_LineLocatePoint('LINESTRING(709243.393033887 163969.752725768,708943.240904444 163974.593889146,708675.634380651 163981.832927298)', 'POINT(705780 15883)');
SELECT 'line_locate_point_1', ST_LineLocatePoint('LINESTRING(709243.393033887 163969.752725768,708943.240904444 163974.593889146,708675.634380651 163981.832927298)', 'POINT(705780 15883)')::numeric(12,6);
--- postgis-users/2006-January/010613.html
select 'line_locate_point_2', ST_LineLocatePoint(ST_geomfromtext('LINESTRING(-1953743.873 471070.784,-1953735.105 471075.419,-1953720.034 471081.649)', 6269), ST_geomfromtext('POINT(-1953720.034 471081.649)', 6269));
......
......@@ -20,7 +20,7 @@ LINEZM_6|MULTIPOINT ZM (9.5 0.5 0.5 2)
#4155.1|MULTILINESTRING Z ((2 2 2,5 5 5))
#4155.2|TIN Z EMPTY
#4155.3|MULTIPOLYGON Z EMPTY
line_locate_point_1|0.528602749909894
line_locate_point_1|0.528603
line_locate_point_2|1
line_locate_point_3|0
line_locate_point_4|0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment