[PostGIS] #5607: ST_SquareGrid fails in edge cases

PostGIS trac at osgeo.org
Sun Nov 12 02:40:26 PST 2023


#5607: ST_SquareGrid fails in edge cases
---------------------+---------------------------
 Reporter:  tobwen   |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 3.4.1
Component:  postgis  |    Version:  3.4.x
 Keywords:           |
---------------------+---------------------------
 ## **summary**

 If a point lies exactly in the corner of a rectangle, four results must be
 returned.

 The documentation should point out that only one geometry is returned. It
 must also be explained how this geometry is selected.

 ### **example 1**
 {{{
 WITH grid AS (
     SELECT (ST_SquareGrid(1000, ST_SetSRID(ST_Point(3183000, 4209000),
 3035))).*
 )
 SELECT
     ST_AsText(geom)
 FROM
     grid;
 }}}

 ### **example 2**
 {{{
 SELECT ST_AsText((ST_SquareGrid(1000, ST_SetSRID(ST_Point(3183000,
 4209000), 3035))).geom);
 }}}

 ### **result**
 {{{
 POLYGON((3183000 4209000,3183000 4210000,3184000 4210000,3184000
 4209000,3183000 4209000))
 }}}

 ### **expected result**
 {{{
 POLYGON((3183000 4209000,3183000 4210000,3184000 4210000,3184000
 4209000,3183000 4209000))
 POLYGON((3183000 4208000,**3183000 4209000**,3184000 4209000,3184000
 4208000,3183000 4208000))
 POLYGON((3182000 4208000,3182000 4209000,**3183000 4209000**,3183000
 4208000,3182000 4208000))
 POLYGON((3182000 4209000,3182000 4210000,3183000 4210000,**3183000
 4209000**,3182000 4209000))
 }}}

 ## **additional notes**

 This is a regression.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5607>
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