Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WFS cached feature iterator empty filter rect #51773

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Feb 8, 2023

Fix #51492

Maybe an upstream (GEOS) issue, this is workaround.

This fails also using ogr:

poly = ogr.CreateGeometryFromWkt('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')
multi_poly = ogr.CreateGeometryFromWkt('MULTIPOLYGON(((0 0, 0 2, 2 2, 2 0, 0 0)))')
bbox = ogr.CreateGeometryFromWkt('POLYGON((1 1, 1 1, 1 1, 1 1, 1 1))')
point = ogr.CreateGeometryFromWkt('POINT(1 1)')
assert poly.Intersects(point)
assert poly.Intersects(bbox)
assert multi_poly.Intersects(point)
assert multi_poly.Intersects(bbox)   ## << fails

@elpaso elpaso added Bug Either a bug report, or a bug fix. Let's hope for the latter! WFS data provider labels Feb 8, 2023
@github-actions github-actions bot added this to the 3.30.0 milestone Feb 8, 2023
@elpaso
Copy link
Contributor Author

elpaso commented Feb 8, 2023

CC @rouault (a test will come)

@rouault
Copy link
Contributor

rouault commented Feb 8, 2023

shouldn't the proper fix be that constGeom.intersects( mFilterRect ) returns true when mFilterRect is degenerated to a point and contained in constGeom ?

@elpaso
Copy link
Contributor Author

elpaso commented Feb 8, 2023

shouldn't the proper fix be that constGeom.intersects( mFilterRect ) returns true when mFilterRect is degenerated to a point and contained in constGeom ?

Do you mean to apply the fix deeper into in bool QgsGeometry::intersects( const QgsGeometry &geometry ) const ?

@elpaso
Copy link
Contributor Author

elpaso commented Feb 8, 2023

... another candidate for the fix is QgsGeometry QgsGeometry::fromRect( const QgsRectangle &rect )

@rouault
Copy link
Contributor

rouault commented Feb 8, 2023

Do you mean to apply the fix deeper into in bool QgsGeometry::intersects( const QgsGeometry &geometry ) const ?

yes

Fix qgis#51492

It is most certainly an upstream issue, this is workaround.
@elpaso elpaso force-pushed the bugfix-gh51492-cachedfeatureiterator-point-filter-rect branch from 183a8a2 to 8a068a2 Compare February 8, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! WFS data provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'overlay_intersects' does not work with WFS-layer
2 participants