Ticket #2454 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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

Reported by: rouault Owned by: 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

Changed 5 years ago by rouault

  • owner changed from warmerdam to rouault

Changed 5 years ago by rouault

Fixed in trunk in r14828 and in r14829.

Changed 5 years ago by rouault

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 1.5.3

Fixed in branches/1.5 in r14830.

Changed 5 years ago by 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.