Opened 5 years ago
Closed 5 years ago
#4495 closed defect (fixed)
Incorrect geometry bbox returned from ST_SnapToGrid
Reported by: | Algunenano | Owned by: | Algunenano |
---|---|---|---|
Priority: | high | Milestone: | PostGIS 2.3.11 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
Following the #4493 and #4494 drill:
WITH geom AS ( SELECT ST_SnapToGrid('POLYGON((0 0, 10 0, 10 10, 10.6 10, 10.5 10.5, 10 10, 0 10, 0 0))', 10) as g ) Select ST_AsText(g) as geometry, postgis_getbbox(g) AS box from geom; geometry | box ------------------------------------+-------------------------------- POLYGON((0 0,10 0,10 10,0 10,0 0)) | BOX(0 0,10.6000003814697 10.5) (1 row)
Change History (6)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
After testing it, the only affected functions are LWGEOM_snaptogrid and LWGEOM_snaptogrid_pointoff, since LWGEOM_SetEffectiveArea and LWGEOM_ChaikinSmoothing don't reuse the input and the output doesn't have a bbox (so it's calculated with lwgeom_add_bbox).
I've added tests for all 4 functions and the fix for the 2 affected by the issue in https://github.com/postgis/postgis/pull/473
Note:
See TracTickets
for help on using tickets.
By following the
/* COMPUTE_BBOX TAINTING */
comment I see this affectsLWGEOM_SetEffectiveArea
,LWGEOM_ChaikinSmoothing
andLWGEOM_snaptogrid
,LWGEOM_snaptogrid_pointoff
.The fix is simple, but I'll try to come up with test to along with it for each function.