From: Nicklas Avén Date: Wed, 28 Nov 2012 22:35:56 +0000 (+0000) Subject: #2112 X-Git-Tag: 2.1.0beta2~353 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7535e8265837ff2d8b9330b0c960b7450a191da8;p=postgis #2112 git-svn-id: http://svn.osgeo.org/postgis/trunk@10747 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/measures3d.c b/liblwgeom/measures3d.c index 2494e53ba..361b29da4 100644 --- a/liblwgeom/measures3d.c +++ b/liblwgeom/measures3d.c @@ -899,9 +899,9 @@ int lw_dist3d_ptarray_poly(POINTARRAY *pa, LWPOLY *poly,PLANE3D *plane, DISTPTS3 } } - projp2=projp1; - s2=s1; - p2=p1; + projp1=projp2; + s1=s2; + p1=p2; } /*check or pointarray against boundary and inner boundaries of the polygon*/ diff --git a/regress/tickets.sql b/regress/tickets.sql index 25ba1632d..d9bf56c0b 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -777,6 +777,15 @@ FROM ( VALUES (3, '010300000001000000100000008D57CD101A214BC0AECDD34E072C4C400DBB72E6EC274BC0A8088D60E32C4C40CF8FD7E6734E4BC0B22695BE4A324C40BFA74213934F4BC020BE505D4C354C4057CD4BEE454E4BC0BA6CF3940F3D4C40E7BDC5FD263E4BC09A4B297D5B484C4073A46A86701C4BC0B287F08D93364C4045501F86701C4BC05EBDB78D93364C40A37DB6586D1C4BC0841E7D2891364C409FBF445F6D1C4BC01E225C5690364C40D1BA97726D1C4BC06E2AF7EA8D364C4019B60C9B751C4BC0D2FD702575364C40FDE4394B5E1F4BC08C40F231CC2F4C402343DF40F51F4BC022008E3D7B2E4C400BB57B45F9204BC0908CE2EA3A2C4C408D57CD101A214BC0AECDD34E072C4C40'::geometry) ) AS f(num, the_geom); +-- #2112 -- Start +SELECT '#2112a', ST_3DDistance(a,b), ST_ASEWKT(ST_3DShortestLine(a,b)) +FROM (SELECT 'POLYGON((1 1 1, 5 1 1,5 5 1, 1 5 1,1 1 1))'::geometry as a, 'LINESTRING(0 0 2, 0 0 0,5 5 2)'::geometry as b + ) as foo; + +SELECT '#2112b', ST_3DDistance(a,b), ST_ASEWKT(ST_3DShortestLine(a,b)) +FROM (SELECT 'POLYGON((1 1 1, 5 1 1,5 5 1, 1 5 1,1 1 1))'::geometry as a, 'LINESTRING(1 0 2, 1 0 0,5 5 -1)'::geometry as b + ) as foo; +-- 2112 -- End -- Clean up DELETE FROM spatial_ref_sys; diff --git a/regress/tickets_expected b/regress/tickets_expected index 61547bf48..387c95abe 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -237,3 +237,5 @@ ERROR: invalid GML representation #2048|1|f|f #2048|2|t|t #2048|3|f|f +#2112a|0|LINESTRING(2.5 2.5 1,2.5 2.5 1) +#2112b|1|LINESTRING(1 1 1,1 0 1)