]> granicus.if.org Git - postgis/commitdiff
Fix cast from box3d to geometry
authorDarafei Praliaskouski <me@komzpa.net>
Thu, 22 Feb 2018 11:16:37 +0000 (11:16 +0000)
committerDarafei Praliaskouski <me@komzpa.net>
Thu, 22 Feb 2018 11:16:37 +0000 (11:16 +0000)
Patch by Matthias Bay

Closes https://github.com/postgis/postgis/pull/214
Closes #4020

git-svn-id: http://svn.osgeo.org/postgis/branches/2.3@16407 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
postgis/lwgeom_box3d.c
regress/regress_expected
regress/sfcgal/regress_expected

diff --git a/NEWS b/NEWS
index c7e42d0e8ca35d57587ba8647c3da7ec895a911c..41406f7a9cdbbaff5c523f8f0b828ee82552d843 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,8 @@ PostGIS 2.3.7dev
 
   - #3978, Fix KNN when upgrading from 2.1 or older (Sandro Santilli)
   - #4003, lwpoly_construct_circle: Avoid division by zero (Raúl Marín Rodríguez)
-
+  - #4020, Casting from box3d to geometry now returns correctly connected
+           PolyhedralSurface (Matthias Bay)
 
 PostGIS 2.3.6
 2018/01/17
index e67b4387c8588653406fd93d0921a0e16e405bd4..fb701c5888ff8eb88d1effbe294b2009e51b59eb 100644 (file)
@@ -328,10 +328,10 @@ Datum BOX3D_to_LWGEOM(PG_FUNCTION_ARGS)
                                        &points[0], &points[1], &points[2], &points[3]));
                /* add top polygon */
                geoms[1] = lwpoly_as_lwgeom(lwpoly_construct_rectangle(LW_TRUE, LW_FALSE,
-                                       &points[4], &points[5], &points[6], &points[7]));
+                                       &points[4], &points[7], &points[6], &points[5]));
                /* add left polygon */
                geoms[2] = lwpoly_as_lwgeom(lwpoly_construct_rectangle(LW_TRUE, LW_FALSE,
-                                       &points[0], &points[1], &points[5], &points[4]));
+                                       &points[0], &points[4], &points[5], &points[1]));
                /* add right polygon */
                geoms[3] = lwpoly_as_lwgeom(lwpoly_construct_rectangle(LW_TRUE, LW_FALSE,
                                        &points[3], &points[2], &points[6], &points[7]));
@@ -340,7 +340,7 @@ Datum BOX3D_to_LWGEOM(PG_FUNCTION_ARGS)
                                        &points[0], &points[3], &points[7], &points[4]));
                /* add front polygon */
                geoms[5] = lwpoly_as_lwgeom(lwpoly_construct_rectangle(LW_TRUE, LW_FALSE,
-                                       &points[1], &points[2], &points[6], &points[5]));
+                                       &points[1], &points[5], &points[6], &points[2]));
 
                geom = (LWGEOM *) lwcollection_construct(POLYHEDRALSURFACETYPE,
                                SRID_UNKNOWN, NULL, ngeoms, geoms);
index bf70ddf7b74407690e60132177e0e045254e005e..e1c8c6ef60ac019c5c647aa2b620b631bb7cd0f8 100644 (file)
@@ -92,7 +92,7 @@ ERROR:  parse error - invalid geometry at character 23
 107c|POLYGON((2 3 5,2 8 5,6 8 5,6 3 5,2 3 5))
 107d|POLYGON((1 -1 4,2 -1 4,2 -1 9,1 -1 9,1 -1 4))
 107e|POLYGON((-1 3 5,-1 6 5,-1 6 8,-1 3 8,-1 3 5))
-107f|POLYHEDRALSURFACE(((1 2 3,1 5 3,4 5 3,4 2 3,1 2 3)),((1 2 6,1 5 6,4 5 6,4 2 6,1 2 6)),((1 2 3,1 5 3,1 5 6,1 2 6,1 2 3)),((4 2 3,4 5 3,4 5 6,4 2 6,4 2 3)),((1 2 3,4 2 3,4 2 6,1 2 6,1 2 3)),((1 5 3,4 5 3,4 5 6,1 5 6,1 5 3)))
+107f|POLYHEDRALSURFACE(((1 2 3,1 5 3,4 5 3,4 2 3,1 2 3)),((1 2 6,4 2 6,4 5 6,1 5 6,1 2 6)),((1 2 3,1 2 6,1 5 6,1 5 3,1 2 3)),((4 2 3,4 5 3,4 5 6,4 2 6,4 2 3)),((1 2 3,4 2 3,4 2 6,1 2 6,1 2 3)),((1 5 3,1 5 6,4 5 6,4 5 3,1 5 3)))
 108|2
 109|4
 110|6
index d0844e4c70f0a5141d3397d3bb94da8ae2d2f599..a61416720ddf211dcc7f1b27f7e6ab9c3def05b5 100644 (file)
@@ -121,7 +121,7 @@ ERROR:  parse error - invalid geometry at character 23
 107c|POLYGON((2 3 5,2 8 5,6 8 5,6 3 5,2 3 5))
 107d|POLYGON((1 -1 4,2 -1 4,2 -1 9,1 -1 9,1 -1 4))
 107e|POLYGON((-1 3 5,-1 6 5,-1 6 8,-1 3 8,-1 3 5))
-107f|POLYHEDRALSURFACE(((1 2 3,1 5 3,4 5 3,4 2 3,1 2 3)),((1 2 6,1 5 6,4 5 6,4 2 6,1 2 6)),((1 2 3,1 5 3,1 5 6,1 2 6,1 2 3)),((4 2 3,4 5 3,4 5 6,4 2 6,4 2 3)),((1 2 3,4 2 3,4 2 6,1 2 6,1 2 3)),((1 5 3,4 5 3,4 5 6,1 5 6,1 5 3)))
+107f|POLYHEDRALSURFACE(((1 2 3,1 5 3,4 5 3,4 2 3,1 2 3)),((1 2 6,4 2 6,4 5 6,1 5 6,1 2 6)),((1 2 3,1 2 6,1 5 6,1 5 3,1 2 3)),((4 2 3,4 5 3,4 5 6,4 2 6,4 2 3)),((1 2 3,4 2 3,4 2 6,1 2 6,1 2 3)),((1 5 3,1 5 6,4 5 6,4 5 3,1 5 3)))
 108|2
 109|4
 110|6