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

Pagination Improvements #495

Closed
pomadchin opened this issue Mar 29, 2022 · 0 comments · Fixed by #496
Closed

Pagination Improvements #495

pomadchin opened this issue Mar 29, 2022 · 0 comments · Fixed by #496
Labels
bug Something isn't working enhancement New feature or request

Comments

@pomadchin
Copy link
Collaborator

pomadchin commented Mar 29, 2022

Describe the bug
We don't support all kinds of paginations, accroding to https://github.com/radiantearth/stac-api-spec/tree/master/item-search#pagination not only next is an acceptable pagination reference, other field names can be used.

To reproduce see https://github.com/pomadchin/stac4s/tree/fix/stac-client and the code sample below:

  describe("Integration test") {
    it("should query by bbox") {
      val filtersString =
        """
          |{
          |    "collections": ["sentinel-s2-l2a-cogs"],
          |    "datetime": "2021-06-01T19:09:23.735395Z/2021-06-30T19:09:23.735395Z",
          |    "bbox": [-92.2646, 46.6930, -92.0276, 46.9739]
          |}""".stripMargin

      val filters = parse(filtersString).flatMap(_.as[SearchFilters]).valueOr(throw _)

      val res = SttpStacClient(backend, uri"https://earth-search.aws.element84.com/v0/search")
        .search(filters)
        .take(30)
        .compile
        .toList
        .unsafeRunSync()

      println(res.length)
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant