Opened 5 years ago

Closed 5 years ago

#4493 closed defect (fixed)

ST_RemoveRepeatedPoints returned geometry bbox might be incorrect

Reported by: Algunenano Owned by: Algunenano
Priority: high Milestone: PostGIS 2.3.11
Component: postgis Version: master
Keywords: Cc:

Description

When the tolerance is > 0, the resulting geometry bbox might change but it isn't updated:

Example:

# WITH geom AS
(
    SELECT ST_RemoveRepeatedPoints('POLYGON((0 0, 10 0, 10 10, 10.5 10.5, 10 10, 0 10, 0 0))', 1) 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.5 10.5)
(1 row)

Time: 0.635 ms

Change History (7)

comment:1 by strk, 5 years ago

Wait, how do removing _repeated_ points can change the bounding box ? I'd think if bounding box changes then something _more_ than _repeated_ points have been removed, which would be a bug

comment:2 by Algunenano, 5 years ago

Wait, how do removing _repeated_ points can change the bounding box ?

Because it has a tolerance value, so different points might be removed.

comment:3 by strk, 5 years ago

Ah right, with tolereance value, yep. So this bug entered codebase in 2.2, if you want to backport the fix till there. Reference: #1137

comment:4 by Raul Marin, 5 years ago

In 17793:

Fix ST_RemoveRepeatedPoints output having an outdated bbox

References #4493
Closes https://github.com/postgis/postgis/pull/472

comment:5 by Raul Marin, 5 years ago

In 17794:

Fix ST_RemoveRepeatedPoints output having an outdated bbox

References #4493

comment:6 by Raul Marin, 5 years ago

In 17795:

Fix ST_RemoveRepeatedPoints output having an outdated bbox

References #4493

comment:7 by Raul Marin, 5 years ago

Resolution: fixed
Status: assignedclosed

In 17796:

Fix ST_RemoveRepeatedPoints output having an outdated bbox

Closes #4493

Note: See TracTickets for help on using tickets.