[PostGIS] #5607: ST_SquareGrid fails in edge cases

PostGIS trac at osgeo.org
Wed Nov 22 14:02:22 PST 2023


#5607: ST_SquareGrid fails in edge cases
----------------------+---------------------------
  Reporter:  tobwen   |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 3.4.2
 Component:  postgis  |    Version:  3.4.x
Resolution:           |   Keywords:
----------------------+---------------------------
Comment (by pramsey):

 When did it have different behaviour?

 You're feeding it a zero-area bounds, and it's producing the one grid
 square that last a lower-left corner "in" that bounds. I can rework the
 documentation to describe the situation better, but I like it more than
 the "four squares returned" option, because it is effectively an open-on-
 one-side interval. You can see this in the 1x1 bounds case
 {{{
 SELECT ST_AsText((ST_SquareGrid(1000,
 ST_SetSRID(ST_MakeLine(ST_Point(3183000, 4209000),ST_Point(3183001,
 4209001)), 3035))).geom);
 }}}
 and also when you push out to a 1000x1000 bounds, again it's hitting just
 the lower left.
 {{{
 SELECT ST_AsText((ST_SquareGrid(1000,
 ST_SetSRID(ST_MakeLine(ST_Point(3183000, 4209000),ST_Point(3184000,
 4210000)), 3035))).geom);
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5607#comment:3>
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