[postgis-devel] [PostGIS] #581: LWGEOM_expand produces inconsistent results
PostGIS
trac at osgeo.org
Tue Sep 7 14:45:24 PDT 2010
#581: LWGEOM_expand produces inconsistent results
---------------------+------------------------------------------------------
Reporter: alexz | Owner: pramsey
Type: defect | Status: new
Priority: high | Milestone: PostGIS 1.5.2
Component: postgis | Version: 1.5.X
Keywords: |
---------------------+------------------------------------------------------
Comment(by mcayland):
Okay - Alex, please can you try the attached patch?
The culprit in this scenario appears to be ptarray_compute_box2d()
introducing errors into the BOX2DFLOAT4 bounding box cache. Currently the
function works by converting each point from double to single precision
and then comparing the extents with the current bounding box to expand it
as required. Unfortunately this has the side effect of introducing
cumulative errors into the bounding box which is why the incorrect answer
is given.
The attached patch works by performing the entire calculation using full
precision BOX3D and then converting to BOX2DFLOAT4 at the end.
Paul, Regina & Kevin - I've tested this patch against 1.5 and trunk and it
appears to pass all regression tests for me. I'd like to get this into
1.5.2 if Alex agrees that this resolves his issue.
Mark.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/581#comment:5>
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-devel
mailing list