-
Notifications
You must be signed in to change notification settings - Fork 36
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
add tests for point search #52
Conversation
test/pgtap/006_tilesearch.sql
Outdated
select '{"type": "FeatureCollection", "features": [{"id": "pgstac-test-item-0097"}]}'::jsonb | ||
$$, | ||
'Test geojsonsearch to return feature collection with all intersecting items intersecting the point' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails right now but should pass
@vincentsarago this is super old ticket, but the entire point of the geometrysearch function is to deal with areas. If we are trying to just find the intersection with a point or line, we should just be using normal search with sortby and sending an intersects geometry. I'm not sure what the case here is for anything extra that the geometrysearch is providing when it isn't an area? |
@bitner I could argue that It works great with https://github.com/stac-utils/titiler-pgstac/blob/main/titiler/pgstac/mosaic.py#L183-L199 I agree that normal |
feel free to close @bitner 🙏 |
Ah, I see the case when you are still using the query hash, but are just looking to get by point. I can make an easy fix there to the geometrysearch function. |
@vincentsarago I've added a check to the geometrysearch function that will set skipcovered and exitwhenfull to false whenever the input geometry is not a polygon. This passes the tests that you added (I just moved the tests to basic sql tests rather than pgtap tests to match the other existing tests). |
This PR adds tests to demonstrate a
bug
with thegeometrysearch
function when passing a geometry withoutarea
(e.g point). Ifexitwhenfull
/skipcovered
are set totrue
the geometrysearch function will always return[]
ref: https://github.com/stac-utils/titiler-pgstac/blob/master/tests/test_titiler_pgstac.py#L46-L53