[postgis-tickets] [PostGIS] #3298: ST_ClosestPoint regression between 2.1.8 and 2.2.0rc1

PostGIS trac at osgeo.org
Tue Sep 29 08:01:33 PDT 2015


#3298: ST_ClosestPoint regression between 2.1.8 and 2.2.0rc1
---------------------+---------------------------
 Reporter:  robe     |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 2.2.0
Component:  postgis  |    Version:  2.1.x
 Keywords:           |
---------------------+---------------------------
 -- tsting

 {{{
 POSTGIS="2.1.8 r13780" GEOS="3.5.0-CAPI-1.9.0 r4088" PROJ="Rel. 4.8.0, 6
 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24" LIBXML="2.7.8"
 LIBJSON="UNKNOWN" RASTER
 }}}


 {{{
 POSTGIS="2.2.0dev r14092" GEOS="3.5.0-CAPI-1.9.0 r4088" PROJ="Rel. 4.9.1,
 04 March 2015" GDAL="GDAL 2.0.1, released 2015/09/15" LIBXML="2.7.8"
 LIBJSON="0.12" RASTER
 }}}



 On both 2.2.0 and 2.1.8 this works
 -- The test
 {{{
 SELECT ST_AsText(ST_3DClosestPoint('SRID=4326;PolyhedralSurface(
 ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
 ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0
 0)),  ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)),
 ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)),  ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0
 1))
 )'::geometry,

 'SRID=4326;PolyhedralSurface(
 ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
 ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)) )'::geometry ))
 }}}

 and gives
 {{{
 POINT Z (0 0 0)
 }}}

 However this test runs in 2.1.8 and throws an error in 2.2


 {{{
 SELECT ST_AsText(ST_3DClosestPoint('SRID=4326;PolyhedralSurface(
 ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
 ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0
 0)),  ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)),
 ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)),  ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0
 1))
 )'::geometry,

 'SRID=4326;POINT(0 0)'::geometry ))
 }}}

 -- in 2.1.8 this gives -


 {{{
 POINT Z (0 0 0)
 }}}


 -- in 2.2.0 it throws an error


 {{{
 ERROR:  Unsupported geometry type: PolyhedralSurface
 }}}

 However:


 {{{
 SELECT ST_AsText(ST_3DClosestPoint('SRID=4326;PolyhedralSurface(
 ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
 ((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0
 0)),  ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)),
 ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)),  ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0
 1))
 )'::geometry,

 'SRID=4326;POINT(0 0 0)'::geometry ));
 }}}

 works and give the

 {{{
 POINT Z (0 0 0)
 }}}



  Is this an intentional change?  I know we went back and forth on what do
 do with 2d, but forgot where the ball fell.

 Anyway regardless the message is wrong since 2 polyhedrals work and a 3D
 point and 3d polyhedral work

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3298>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list