-
Notifications
You must be signed in to change notification settings - Fork 48
Description
I had an old version of pgstac running, which I have just upgraded to the latest version. Since then, I've found that some of the search queries I've run have returned incorrect results. I actually found the incorrect results when querying using stac_fastapi, but I've checked by running queries using the underlying pgstac SQL functions and have found that they are returning incorrect results, which are then just displayed by stac_fastapi).
For example, when running the query:
SELECT * FROM pgstac.search('{"collection":"test-bec-4"}'::jsonb)
I get a JSON result which starts like this:
{
"next": "N51E000.tif",
"prev": null,
"type": "FeatureCollection",
"context": {
"limit": 10,
"returned": 10
},
"features": [
{
"id": "core-4",
"bbox": [
35,
19.3,
35,
19.3
],
"type": "Feature",
"links": [
{
"rel": "self",
"href": "http://localhost/test.tif",
"type": "application/json"
}
],
"assets": {},
"geometry": {
"type": "Point",
"coordinates": [
35,
19.3
]
},
"collection": "test-anglo-cores-3",
"properties": {
"datetime": "2020-02-08T11:23:00Z",
"core-type": "shallow",
"last-reviewed": "2021-03-19"
},
...
In that returned JSON, it lists the collection as test-anglo-cores-3 not test-bec-4.
Running
SELECT * FROM items WHERE collection_id = 'test-bec-4'
gives me 100 results, which is the correct number - and shows that there are items in the database with that collection ID. I've also checked the content field of the items table, and in there the collection is also specified correctly as test-bec-4.
I have no idea how to go forward with debugging this, as my SQL skills are quite limited. Any help would be very much appreciated.