Pagination Improvements · Issue #495 · stac-utils/stac4s · GitHub
Skip to content

Pagination Improvements #495

Closed
Closed

Description

@pomadchin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions