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

Filtering by id doesn't work #37

Closed
drnextgis opened this issue Feb 18, 2022 · 4 comments
Closed

Filtering by id doesn't work #37

drnextgis opened this issue Feb 18, 2022 · 4 comments

Comments

@drnextgis
Copy link
Contributor

Create a search by providing a list of ids:

$ curl -s -X 'POST' \
  'http://0.0.0.0:8081/register' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "ids": [
    "newsat20_micro_L1_a6862829-8f18-4ac3-9e71-3d7be4bff1f3_0_40_1_3_3",
    "newsat20_micro_L1_a6862829-8f18-4ac3-9e71-3d7be4bff1f3_0_40_1_3_4"
  ]
}' | jq
{
  "searchid": "31e80bcee45da399dddad8d97b79e9da",
  "metadata": "http://0.0.0.0:8081/31e80bcee45da399dddad8d97b79e9da/info",
  "tiles": "http://0.0.0.0:8081/31e80bcee45da399dddad8d97b79e9da/tilejson.json"
}

Check the search info:

curl -s -X 'GET' \
  'http://0.0.0.0:8081/31e80bcee45da399dddad8d97b79e9da/info' \
  -H 'accept: application/json' | jq
{
  "hash": "31e80bcee45da399dddad8d97b79e9da",
  "search": {
    "ids": [
      "newsat20_micro_L1_a6862829-8f18-4ac3-9e71-3d7be4bff1f3_0_40_1_3_3",
      "newsat20_micro_L1_a6862829-8f18-4ac3-9e71-3d7be4bff1f3_0_40_1_3_4"
    ]
  },
  "_where": " TRUE ",
  "orderby": "datetime DESC, id DESC",
  "lastused": "2022-02-18T00:47:56.524663+00:00",
  "usecount": 5,
  "metadata": {}
}

Check the assets by the given searchid:

$ curl -s -X 'GET' \
  'http://0.0.0.0:8081/31e80bcee45da399dddad8d97b79e9da/-42.0,-12.7/assets' \
  -H 'accept: application/json' | jq ".[0].id"
"newsat20_micro_L1_a6862829-8f18-4ac3-9e71-3d7be4bff1f3_0_40_1_0_10"

As you can see I get an asset which doesn't meet the search criteria. I understand that it is probably connected with switching to cql2 (I use pgstac v0.4.5) but then it would be good have it mentioned in the docs.

@vincentsarago
Copy link
Member

I think this is the same as stac-utils/stac-fastapi#346

@drnextgis
Copy link
Contributor Author

I use latest version of PGStac 0.4.5 or do you mean it requires changes on titiler-pgstac side?

@vincentsarago
Copy link
Member

do you mean it requires changes on titiler-pgstac side?

I think yes, but I need to go through the PR to see what changes are required for the filter-lang. Or we could only support the cql filter 😄

@vincentsarago
Copy link
Member

added tests in e63e350 and couldn't reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants