Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2454 closed defect (fixed)

OGRLayer::FilterGeometry is selecting more features than expected when the filter geometry is an envelope

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.5.3
Component: OGR_SF Version:
Severity: normal Keywords: ogr filter geometry
Cc:

Description

This is due to the following code which assumes that if the filter is an envelope, we don't have further tests to do. The current code keeps features that should be discarded

/* -------------------------------------------------------------------- */
/*      Fallback to full intersect test (using GEOS) if we still        */
/*      don't know for sure.                                            */
/* -------------------------------------------------------------------- */
    if( m_bFilterIsEnvelope )
        return TRUE;
    else
    {
        if( OGRGeometryFactory::haveGEOS() )
            return m_poFilterGeom->Intersects( poGeometry );
        else
            return TRUE;
    }

Current state of ogr_shape_9 test is a consequence of this wrong test.

###############################################################################
# Test that we don't return a polygon if we are "inside" but non-overlapping.
# For now we actually do return this shape, but eventually we won't.

def ogr_shape_9():

Change History (4)

comment:1 Changed 11 years ago by Even Rouault

Owner: changed from warmerdam to Even Rouault

comment:2 Changed 11 years ago by Even Rouault

Fixed in trunk in r14828 and in r14829.

comment:3 Changed 11 years ago by Even Rouault

Milestone: 1.5.3
Resolution: fixed
Status: newclosed

Fixed in branches/1.5 in r14830.

comment:4 Changed 11 years ago by Even Rouault

Small change in ogr_shape_9 test whose result now depend on whether GDAL has GEOS support or not. r14832 and r14833

Note: See TracTickets for help on using tickets.