diff --git a/.circleci/config.yml b/.circleci/config.yml index 625457ee..b0db9b4e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,25 +35,25 @@ aliases: command: ./scripts/cipublish # Build environments - - &openjdk8-scala2_12_13_environment + - &openjdk8-scala2_12_14_environment docker: - image: circleci/openjdk:8-jdk environment: - SCALA_VERSION: 2.12.13 + SCALA_VERSION: 2.12.14 version: 2 workflows: version: 2 build: jobs: - - "openjdk8-scala2.12.13": - filters: # required since `openjdk8-scala2.12.12_deploy` has tag filters AND requires `openjdk8-scala2.12.12` + - "openjdk8-scala2.12.14": + filters: # required since `openjdk8-scala2.12.14_deploy` has tag filters AND requires `openjdk8-scala2.12.14` tags: only: - /^(.*)$/ - - "openjdk8-scala2.12.13_deploy": + - "openjdk8-scala2.12.14_deploy": requires: - - "openjdk8-scala2.12.13" + - "openjdk8-scala2.12.14" filters: tags: only: @@ -65,10 +65,10 @@ workflows: - /hotfix\/.*/ jobs: - "openjdk8-scala2.12.13": - <<: *openjdk8-scala2_12_13_environment + "openjdk8-scala2.12.14": + <<: *openjdk8-scala2_12_14_environment steps: *run_cibuild - "openjdk8-scala2.12.13_deploy": - <<: *openjdk8-scala2_12_13_environment + "openjdk8-scala2.12.14_deploy": + <<: *openjdk8-scala2_12_14_environment steps: *run_cipublish diff --git a/CHANGELOG.md b/CHANGELOG.md index 80e81482..8b29243e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Changed - OgcTime logic cleanup [#371](https://github.com/geotrellis/geotrellis-server/pull/371) - Change RGB nodata handling [#373](https://github.com/geotrellis/geotrellis-server/pull/373) +- Update STAC up to v1.0.0 [#376](https://github.com/geotrellis/geotrellis-server/pull/376) ## [4.4.0] - 2021-04-30 diff --git a/build.sbt b/build.sbt index 878254f8..dc23d244 100644 --- a/build.sbt +++ b/build.sbt @@ -50,7 +50,8 @@ lazy val commonSettings = Seq( "osgeo-snapshots" at "https://repo.osgeo.org/repository/snapshot/", "osgeo-releases" at "https://repo.osgeo.org/repository/release/", "eclipse-releases" at "https://repo.eclipse.org/content/groups/releases", - "eclipse-snapshots" at "https://repo.eclipse.org/content/groups/snapshots" + "eclipse-snapshots" at "https://repo.eclipse.org/content/groups/snapshots", + "jitpack" at "https://jitpack.io" ), addCompilerPlugin(kindProjector cross CrossVersion.full), addCompilerPlugin(macrosParadise cross CrossVersion.full), diff --git a/example/src/main/scala/geotrellis/server/example/ndvi/NdviServer.scala b/example/src/main/scala/geotrellis/server/example/ndvi/NdviServer.scala index 850c9096..bd6b73cd 100644 --- a/example/src/main/scala/geotrellis/server/example/ndvi/NdviServer.scala +++ b/example/src/main/scala/geotrellis/server/example/ndvi/NdviServer.scala @@ -49,7 +49,7 @@ object NdviServer extends IOApp { val createServer: Resource[IO, Server[IO]] = { for { conf <- ExampleConf.loadResourceF[IO](None) - _ <- Resource.liftF { + _ <- Resource.eval { logger.info( s"Initializing NDVI service at ${conf.http.interface}:${conf.http.port}/" ) @@ -57,7 +57,7 @@ object NdviServer extends IOApp { mamlNdviRendering = new NdviService[IO, GeoTiffNode]( ConcurrentInterpreter.DEFAULT ) - server <- BlazeServerBuilder[IO] + server <- BlazeServerBuilder[IO](executionContext) .enableHttp2(true) .bindHttp(conf.http.port, conf.http.interface) .withHttpApp( diff --git a/example/src/main/scala/geotrellis/server/example/persistence/PersistenceServer.scala b/example/src/main/scala/geotrellis/server/example/persistence/PersistenceServer.scala index cfb744c8..56ba3244 100644 --- a/example/src/main/scala/geotrellis/server/example/persistence/PersistenceServer.scala +++ b/example/src/main/scala/geotrellis/server/example/persistence/PersistenceServer.scala @@ -50,7 +50,7 @@ object PersistenceServer extends IOApp { val createServer = { for { conf <- ExampleConf.loadResourceF[IO](None) - _ <- Resource.liftF { + _ <- Resource.eval { logger.info( s"Initializing persistence demo at ${conf.http.interface}:${conf.http.port}/" ) @@ -66,7 +66,7 @@ object PersistenceServer extends IOApp { ]( mamlStore ) - server <- BlazeServerBuilder[IO] + server <- BlazeServerBuilder[IO](executionContext) .enableHttp2(true) .bindHttp(conf.http.port, conf.http.interface) .withHttpApp( diff --git a/ogc-example/src/main/scala/geotrellis/server/ogc/Main.scala b/ogc-example/src/main/scala/geotrellis/server/ogc/Main.scala index cc1d9003..b53596dc 100644 --- a/ogc-example/src/main/scala/geotrellis/server/ogc/Main.scala +++ b/ogc-example/src/main/scala/geotrellis/server/ogc/Main.scala @@ -114,7 +114,7 @@ object Main for { conf <- Conf.loadResourceF[IO](configPath) simpleSources = conf.layers.values.collect { case rsc: RasterSourceConf => rsc.toLayer }.toList - _ <- Resource.liftF( + _ <- Resource.eval( logOptState( conf.wms, ansi"%green{WMS configuration detected}, starting Web Map Service", @@ -129,7 +129,7 @@ object Main ExtendedParameters.extendedParametersBinding ) } - _ <- Resource.liftF( + _ <- Resource.eval( logOptState( conf.wmts, ansi"%green{WMTS configuration detected}, starting Web Map Tiling Service", @@ -143,7 +143,7 @@ object Main svc.layerSources(simpleSources) ) } - _ <- Resource.liftF( + _ <- Resource.eval( logOptState( conf.wcs, ansi"%green{WCS configuration detected}, starting Web Coverage Service", diff --git a/ogc-example/src/main/scala/geotrellis/server/ogc/conf/Conf.scala b/ogc-example/src/main/scala/geotrellis/server/ogc/conf/Conf.scala index b9f9a2f5..95180929 100644 --- a/ogc-example/src/main/scala/geotrellis/server/ogc/conf/Conf.scala +++ b/ogc-example/src/main/scala/geotrellis/server/ogc/conf/Conf.scala @@ -51,7 +51,7 @@ object Conf { } def loadResourceF[F[_]: Sync](configPath: Option[String]): Resource[F, Conf] = - Resource.liftF(loadF[F](configPath)) + Resource.eval(loadF[F](configPath)) // This is a work-around to use pureconfig to read scalaxb generated case classes // DataRecord should never be specified from configuration, this satisfied the resolution diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 7d2f18b4..e5f9d031 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -6,20 +6,20 @@ object Dependencies { def catsVersion(module: String) = Def.setting { module match { - case "core" => "org.typelevel" %% s"cats-$module" % "2.4.2" - case "effect" => "org.typelevel" %% s"cats-$module" % "2.3.3" + case "core" => "org.typelevel" %% s"cats-$module" % "2.6.1" + case "effect" => "org.typelevel" %% s"cats-$module" % "2.5.1" } } - def circeVersion(module: String) = Def.setting { "io.circe" %% s"circe-$module" % "0.13.0" } - def http4sVer(module: String) = Def.setting { "org.http4s" %% s"http4s-$module" % "0.21.20" } + def circeVersion(module: String) = Def.setting { "io.circe" %% s"circe-$module" % "0.14.1" } + def http4sVer(module: String) = Def.setting { "org.http4s" %% s"http4s-$module" % "0.21.24" } - val crossScalaVer = List("2.12.13") + val crossScalaVer = List("2.12.14") val scalaVer = crossScalaVer.head val dispatchVer = "0.11.3" val gtVer = "3.6.0" - val stac4sVer = "0.4.0-9-gb8eb735-SNAPSHOT" + val stac4sVer = "0.5.0-8-gaab61a6-SNAPSHOT" val jaxbApiVer = "2.3.1" val refinedVer = "0.9.20" val shapelessVer = "2.3.3" @@ -30,11 +30,11 @@ object Dependencies { val circeShapes = circeVersion("shapes") val circeGeneric = circeVersion("generic") val circeGenericExtras = circeVersion("generic-extras") - val circeOptics = Def.setting { "io.circe" %% "circe-optics" % "0.13.0" } + val circeOptics = Def.setting { "io.circe" %% "circe-optics" % "0.14.1" } val circeParser = circeVersion("parser") val circeRefined = circeVersion("refined") val circeJava8 = circeVersion("java8") - val commonsIO = "commons-io" % "commons-io" % "2.8.0" + val commonsIO = "commons-io" % "commons-io" % "2.9.0" val concHashMap = "com.googlecode.concurrentlinkedhashmap" % "concurrentlinkedhashmap-lru" % "1.4.2" val decline = "com.monovore" %% "decline" % "1.4.0" val geotrellisRaster = "org.locationtech.geotrellis" %% "geotrellis-raster" % gtVer @@ -53,17 +53,17 @@ object Dependencies { val http4sXml = http4sVer("scala-xml") val jaxbApi = "javax.xml.bind" % "jaxb-api" % jaxbApiVer val kindProjector = "org.typelevel" %% "kind-projector" % "0.13.0" - val semanticdbScalac = "org.scalameta" % "semanticdb-scalac" % "4.4.18" + val semanticdbScalac = "org.scalameta" % "semanticdb-scalac" % "4.4.21" val log4cats = "io.chrisdavenport" %% "log4cats-slf4j" % "1.1.1" val mamlJvm = "com.azavea.geotrellis" %% "maml-jvm" % "0.6.1" val pureConfig = "com.github.pureconfig" %% "pureconfig" % "0.14.1" val pureConfigCatsEffect = "com.github.pureconfig" %% "pureconfig-cats-effect" % "0.14.1" - val scaffeine = "com.github.blemale" %% "scaffeine" % "4.0.2" + val scaffeine = "com.github.blemale" %% "scaffeine" % "4.1.0" val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.3.0" - val scalatest = "org.scalatest" %% "scalatest" % "3.2.5" % Test + val scalatest = "org.scalatest" %% "scalatest" % "3.2.9" % Test val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.0" % Test val scalacheckCats = "io.chrisdavenport" %% "cats-scalacheck" % "0.1.1" % Test - val sttpHttp4s = "com.softwaremill.sttp.client3" %% "http4s-ce2-backend" % "3.3.4" + val sttpHttp4s = "com.softwaremill.sttp.client3" %% "http4s-ce2-backend" % "3.3.6" val macrosParadise = "org.scalamacros" % "paradise" % "2.1.1" val scalaParser = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2" val shapeless = "com.chuusai" %% "shapeless" % shapelessVer diff --git a/project/plugins.sbt b/project/plugins.sbt index d638c2cf..bfa93dd3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -10,4 +10,4 @@ addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.0") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.5.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.19") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29") diff --git a/stac-example/Makefile b/stac-example/Makefile index 49cf3b5c..b58d474d 100644 --- a/stac-example/Makefile +++ b/stac-example/Makefile @@ -10,7 +10,7 @@ postgres: migrations: docker run --rm \ --network stac-example_default \ - quay.io/azavea/franklin:367cdc7 \ + quay.io/azavea/franklin:1574674 \ migrate \ --db-user franklin \ --db-name franklin \ @@ -23,7 +23,7 @@ import-landsat-stac-collection: --network stac-example_default \ -e AWS_REGION=us-east-1 \ -v ${PWD}/catalog:/opt/data/ \ - quay.io/azavea/franklin:367cdc7 \ + quay.io/azavea/franklin:1574674 \ import-catalog \ --db-user franklin \ --db-name franklin \ @@ -36,7 +36,7 @@ import-landsat-stac-periodic-collection: --network stac-example_default \ -e AWS_REGION=us-east-1 \ -v ${PWD}/catalog:/opt/data/ \ - quay.io/azavea/franklin:367cdc7 \ + quay.io/azavea/franklin:1574674 \ import-catalog \ --db-user franklin \ --db-name franklin \ @@ -49,7 +49,7 @@ import-landsat-stac-layers: --network stac-example_default \ -e AWS_REGION=us-east-1 \ -v ${PWD}/catalog:/opt/data/ \ - quay.io/azavea/franklin:367cdc7 \ + quay.io/azavea/franklin:1574674 \ import-catalog \ --db-user franklin \ --db-name franklin \ @@ -61,7 +61,7 @@ run-franklin: docker run --rm \ --network stac-example_default \ -p 9090:9090 \ - quay.io/azavea/franklin:367cdc7 \ + quay.io/azavea/franklin:1574674 \ serve \ --db-user franklin \ --db-name franklin \ diff --git a/stac-example/catalog/landsat-stac-collection/catalog.json b/stac-example/catalog/landsat-stac-collection/catalog.json index 81ef09f5..28cd759a 100644 --- a/stac-example/catalog/landsat-stac-collection/catalog.json +++ b/stac-example/catalog/landsat-stac-collection/catalog.json @@ -1,6 +1,6 @@ { "type": "Catalog", - "stac_version": "1.0.0-rc.2", + "stac_version": "1.0.0", "stac_extensions": [], "id": "landsat-stac-collection-catalog", "title": "STAC for Landsat data", diff --git a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-05/LC80150322018141LGN00.json b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-05/LC80150322018141LGN00.json index d2c61ff8..fd9f12d4 100644 --- a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-05/LC80150322018141LGN00.json +++ b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-05/LC80150322018141LGN00.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "LC80150322018141LGN00", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-06/LC80140332018166LGN00.json b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-06/LC80140332018166LGN00.json index 7d1e1d0a..9648f43c 100644 --- a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-06/LC80140332018166LGN00.json +++ b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-06/LC80140332018166LGN00.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "LC80140332018166LGN00", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-06/LC80300332018166LGN00.json b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-06/LC80300332018166LGN00.json index b4036875..578ec28e 100644 --- a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-06/LC80300332018166LGN00.json +++ b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-06/LC80300332018166LGN00.json @@ -1,6 +1,6 @@ { "type": "Feature", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-07/LC80150332018189LGN00.json b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-07/LC80150332018189LGN00.json index f8c9c8a4..06bf5bf7 100644 --- a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-07/LC80150332018189LGN00.json +++ b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/2018-07/LC80150332018189LGN00.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "LC80150332018189LGN00", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/catalog.json b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/catalog.json index 37d5c3e9..0365e1a0 100644 --- a/stac-example/catalog/landsat-stac-collection/landsat-8-l1/catalog.json +++ b/stac-example/catalog/landsat-stac-collection/landsat-8-l1/catalog.json @@ -1,6 +1,6 @@ { "type": "Collection", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-layers/catalog.json b/stac-example/catalog/landsat-stac-layers/catalog.json index 2e9c46d2..3a900c78 100644 --- a/stac-example/catalog/landsat-stac-layers/catalog.json +++ b/stac-example/catalog/landsat-stac-layers/catalog.json @@ -1,6 +1,6 @@ { "type": "Catalog", - "stac_version": "1.0.0-rc.2", + "stac_version": "1.0.0", "stac_extensions": [], "id": "landsat-stac-layers-catalog", "title": "STAC for Landsat data", diff --git a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-05/LC80150322018141LGN00.json b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-05/LC80150322018141LGN00.json index 30f3cefd..0c61a5f1 100644 --- a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-05/LC80150322018141LGN00.json +++ b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-05/LC80150322018141LGN00.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "LC80150322018141LGN00", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-06/LC80140332018166LGN00.json b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-06/LC80140332018166LGN00.json index cd1b2d51..4afa2edc 100644 --- a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-06/LC80140332018166LGN00.json +++ b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-06/LC80140332018166LGN00.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "LC80140332018166LGN00", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-06/LC80300332018166LGN00.json b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-06/LC80300332018166LGN00.json index 6b3c58b3..3385f23f 100644 --- a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-06/LC80300332018166LGN00.json +++ b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-06/LC80300332018166LGN00.json @@ -1,6 +1,6 @@ { "type": "Feature", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-07/LC80150332018189LGN00.json b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-07/LC80150332018189LGN00.json index 28b941fc..685c20a8 100644 --- a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-07/LC80150332018189LGN00.json +++ b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/2018-07/LC80150332018189LGN00.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "LC80150332018189LGN00", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/catalog.json b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/catalog.json index 37d5c3e9..0365e1a0 100644 --- a/stac-example/catalog/landsat-stac-layers/landsat-8-l1/catalog.json +++ b/stac-example/catalog/landsat-stac-layers/landsat-8-l1/catalog.json @@ -1,6 +1,6 @@ { "type": "Collection", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-layers/layers/catalog.json b/stac-example/catalog/landsat-stac-layers/layers/catalog.json index 89a291c3..90736e1f 100644 --- a/stac-example/catalog/landsat-stac-layers/layers/catalog.json +++ b/stac-example/catalog/landsat-stac-layers/layers/catalog.json @@ -1,6 +1,6 @@ { "type": "Catalog", - "stac_version": "1.0.0-rc.2", + "stac_version": "1.0.0", "stac_extensions": [], "id": "layer-us-global", "title": "Landsat 8 L1", diff --git a/stac-example/catalog/landsat-stac-layers/layers/pa.json b/stac-example/catalog/landsat-stac-layers/layers/pa.json index 09eb8f58..5c7841d9 100644 --- a/stac-example/catalog/landsat-stac-layers/layers/pa.json +++ b/stac-example/catalog/landsat-stac-layers/layers/pa.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "layer-pa", - "stac_version": "1.0.0-rc.2", + "stac_version": "1.0.0", "stac_extensions": [ "layer" ], diff --git a/stac-example/catalog/landsat-stac-layers/layers/us.json b/stac-example/catalog/landsat-stac-layers/layers/us.json index e4662cbc..bf608a12 100644 --- a/stac-example/catalog/landsat-stac-layers/layers/us.json +++ b/stac-example/catalog/landsat-stac-layers/layers/us.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "layer-us", - "stac_version": "1.0.0-rc.2", + "stac_version": "1.0.0", "stac_extensions": [ "layer" ], diff --git a/stac-example/catalog/landsat-stac-periodic-collection/catalog.json b/stac-example/catalog/landsat-stac-periodic-collection/catalog.json index b269d59c..70da0c42 100644 --- a/stac-example/catalog/landsat-stac-periodic-collection/catalog.json +++ b/stac-example/catalog/landsat-stac-periodic-collection/catalog.json @@ -1,6 +1,6 @@ { "type": "Catalog", - "stac_version": "1.0.0-rc.2", + "stac_version": "1.0.0", "stac_extensions": [], "id": "landsat-stac-periodic-catalog", "title": "STAC for Landsat data", diff --git a/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-05/LC80150322018141LGN00.json b/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-05/LC80150322018141LGN00.json index 8cc1d6fa..ca01121b 100644 --- a/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-05/LC80150322018141LGN00.json +++ b/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-05/LC80150322018141LGN00.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "LC80150322018141LGN00", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-06/LC80140332018166LGN00.json b/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-06/LC80140332018166LGN00.json index bb400a94..c25c242f 100644 --- a/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-06/LC80140332018166LGN00.json +++ b/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-06/LC80140332018166LGN00.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "LC80140332018166LGN00", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-07/LC80150332018189LGN00.json b/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-07/LC80150332018189LGN00.json index c78555db..0ff80917 100644 --- a/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-07/LC80150332018189LGN00.json +++ b/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/2018-07/LC80150332018189LGN00.json @@ -1,7 +1,7 @@ { "type": "Feature", "id": "LC80150332018189LGN00", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/catalog.json b/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/catalog.json index 94206be4..2d5033b0 100644 --- a/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/catalog.json +++ b/stac-example/catalog/landsat-stac-periodic-collection/landsat-8-l1/catalog.json @@ -1,6 +1,6 @@ { "type": "Collection", - "stac_version" : "1.0.0-rc.2", + "stac_version" : "1.0.0", "stac_extensions" : [ "eo", "view", diff --git a/stac-example/src/main/scala/geotrellis/server/ogc/stac/SearchFiltersQuery.scala b/stac-example/src/main/scala/geotrellis/server/ogc/stac/SearchFiltersQuery.scala index a29dace1..ed3cb930 100644 --- a/stac-example/src/main/scala/geotrellis/server/ogc/stac/SearchFiltersQuery.scala +++ b/stac-example/src/main/scala/geotrellis/server/ogc/stac/SearchFiltersQuery.scala @@ -21,7 +21,7 @@ import geotrellis.store.query.{Query, QueryF} import geotrellis.proj4.LatLng import com.azavea.stac4s.{Bbox, TwoDimBbox} -import com.azavea.stac4s.jvmTypes.TemporalExtent +import com.azavea.stac4s.TemporalExtent import com.azavea.stac4s.api.client.{SearchFilters, StacClient, Superset} import io.circe.syntax._ import higherkindness.droste.{scheme, Algebra} @@ -58,14 +58,10 @@ object SearchFiltersQuery { TwoDimBbox(xmin, ymin, xmax, ymax) } - implicit val temporalExtentSemigroup: Semigroup[TemporalExtent] = { (left, right) => - val (lmin, lmax) = left.value.min -> left.value.max - val (rmin, rmax) = right.value.min -> right.value.max - TemporalExtent.unsafeFrom( - List( - List(lmin, rmin).max, - List(lmax, rmax).min - ) + implicit val temporalExtentSemigroup: Semigroup[TemporalExtent] = { case (TemporalExtent(lstart, lend), TemporalExtent(rstart, rend)) => + TemporalExtent( + (lstart.toList ::: rstart.toList).sorted.lastOption, + (lend.toList ::: rend.toList).sorted.headOption ) } @@ -98,14 +94,10 @@ object SearchFiltersQuery { TwoDimBbox(xmin, ymin, xmax, ymax) } - implicit val temporalExtentSemigroup: Semigroup[TemporalExtent] = { (left, right) => - val (lmin, lmax) = left.value.min -> left.value.max - val (rmin, rmax) = right.value.min -> right.value.max - TemporalExtent.unsafeFrom( - List( - List(lmin, rmin).min, - List(lmax, rmax).max - ) + implicit val temporalExtentSemigroup: Semigroup[TemporalExtent] = { case (TemporalExtent(lstart, lend), TemporalExtent(rstart, rend)) => + TemporalExtent( + (lstart.toList ::: rstart.toList).sorted.headOption, + (lend.toList ::: rend.toList).sorted.lastOption ) } diff --git a/stac-example/src/main/scala/geotrellis/server/ogc/stac/package.scala b/stac-example/src/main/scala/geotrellis/server/ogc/stac/package.scala index 5d7f07c4..d217fc0a 100644 --- a/stac-example/src/main/scala/geotrellis/server/ogc/stac/package.scala +++ b/stac-example/src/main/scala/geotrellis/server/ogc/stac/package.scala @@ -22,8 +22,7 @@ import geotrellis.store.query._ import geotrellis.raster.{EmptyName, RasterSource, SourceName, StringName} import geotrellis.raster.geotiff.GeoTiffPath import geotrellis.server.ogc.stac.util.logging.{StacClientLoggingMid, StreamingStacClientLoggingMid} - -import com.azavea.stac4s.{StacAsset, StacExtent} +import com.azavea.stac4s.{StacAsset, StacExtent, TemporalExtent} import com.azavea.stac4s.api.client.{SearchFilters, StacClient, StreamingStacClient, StreamingStacClientFS2, Query => SQuery} import com.azavea.stac4s.extensions.periodic.PeriodicExtent import com.azavea.stac4s.syntax._ @@ -32,7 +31,6 @@ import cats.{Applicative, Foldable, Functor, FunctorFilter} import cats.data.NonEmptyList import cats.effect.Sync import cats.syntax.either._ - import cats.syntax.foldable._ import cats.syntax.functorFilter._ import cats.syntax.applicative._ @@ -68,11 +66,12 @@ package object stac { implicit class StacExtentionOps(val self: StacExtent) extends AnyVal { /** [[StacExtent]]s with no temporal component are valid. */ - def ogcTime: Option[OgcTime] = self.temporal.interval.headOption.map(_.value.flatten.map(_.atZone(ZoneOffset.UTC))).map { - case fst :: Nil => OgcTimeInterval(fst) - case fst :: snd :: Nil => OgcTimeInterval(fst, snd, self.temporal.getExtensionFields[PeriodicExtent].map(_.period).toOption) - case _ => OgcTimeEmpty - } + def ogcTime: Option[OgcTime] = + self.temporal.interval.headOption.map { case TemporalExtent(start, end) => List(start, end).flatten.map(_.atZone(ZoneOffset.UTC)) }.map { + case fst :: Nil => OgcTimeInterval(fst) + case fst :: snd :: Nil => OgcTimeInterval(fst, snd, self.temporal.getExtensionFields[PeriodicExtent].map(_.period).toOption) + case _ => OgcTimeEmpty + } } implicit class StacSummaryOps(val self: StacSummary) extends AnyVal { diff --git a/stac-example/src/main/scala/geotrellis/server/ogc/stac/util/logging/StacClientLoggingMid.scala b/stac-example/src/main/scala/geotrellis/server/ogc/stac/util/logging/StacClientLoggingMid.scala index fa122150..439f9184 100644 --- a/stac-example/src/main/scala/geotrellis/server/ogc/stac/util/logging/StacClientLoggingMid.scala +++ b/stac-example/src/main/scala/geotrellis/server/ogc/stac/util/logging/StacClientLoggingMid.scala @@ -18,11 +18,12 @@ package geotrellis.server.ogc.stac.util.logging import cats.effect.Sync import cats.syntax.flatMap._ -import com.azavea.stac4s.api.client.{SearchFilters, StreamingStacClient, StreamingStacClientF} +import com.azavea.stac4s.api.client.{ETag, SearchFilters, StreamingStacClient, StreamingStacClientF} import com.azavea.stac4s.{StacCollection, StacItem} import eu.timepit.refined.types.string.NonEmptyString import fs2.Stream import io.chrisdavenport.log4cats.slf4j.Slf4jLogger +import io.circe.Json import io.circe.syntax._ import tofu.higherKind.Mid @@ -39,23 +40,36 @@ final class StacClientLoggingMid[F[_]: Sync] extends StreamingStacClientF[Mid[F, def collection(collectionId: NonEmptyString): Mid[F, StacCollection] = res => - logger.trace(s"collections collectionId: $collectionId endpoint call") >> + logger.trace(s"collections collectionId: $collectionId") >> res.flatTap(collection => logger.trace(s"retrieved collection: ${collection.asJson}")) - def item(collectionId: NonEmptyString, itemId: NonEmptyString): Mid[F, StacItem] = + def collectionCreate(collection: StacCollection): Mid[F, StacCollection] = res => - logger.trace(s"item by collectionId: $collectionId and itemId: $itemId endpoint call") >> + logger.trace(s"collectionCreate of collection: $collection") >> + res.flatTap(collection => logger.trace(s"created collection: ${collection.asJson}")) + + def item(collectionId: NonEmptyString, itemId: NonEmptyString): Mid[F, ETag[StacItem]] = + res => + logger.trace(s"item by collectionId: $collectionId and itemId: $itemId") >> res.flatTap(item => logger.trace(s"retrieved item: ${item.asJson}")) - def itemCreate(collectionId: NonEmptyString, item: StacItem): Mid[F, StacItem] = + def itemCreate(collectionId: NonEmptyString, item: StacItem): Mid[F, ETag[StacItem]] = res => logger.trace(s"itemCreate for collectionId: $collectionId and item: $item") >> res.flatTap(item => logger.trace(s"created item: ${item.asJson}")) - def collectionCreate(collection: StacCollection): Mid[F, StacCollection] = + def itemUpdate(collectionId: NonEmptyString, item: ETag[StacItem]): Mid[F, ETag[StacItem]] = res => - logger.trace(s"collectionCreate of collection: $collection") >> - res.flatTap(collection => logger.trace(s"created collection: ${collection.asJson}")) + logger.trace(s"itemUpdate for collectionId: $collectionId and item: $item") >> + res.flatTap(item => logger.trace(s"retrieved item: ${item.asJson}")) + + def itemPatch(collectionId: NonEmptyString, itemId: NonEmptyString, patch: ETag[Json]): Mid[F, ETag[StacItem]] = + res => + logger.trace(s"itemPath for collectionId: $collectionId, itemId: $itemId and patch: $patch") >> + res.flatTap(item => logger.trace(s"retrieved item: ${item.asJson}")) + + def itemDelete(collectionId: NonEmptyString, itemId: NonEmptyString): Mid[F, Either[String, String]] = + res => logger.trace(s"itemDelete for collectionId: $collectionId and itemId: $itemId") >> res } object StacClientLoggingMid { diff --git a/stac-example/src/main/scala/geotrellis/server/ogc/stac/util/logging/StreamingStacClientLoggingMid.scala b/stac-example/src/main/scala/geotrellis/server/ogc/stac/util/logging/StreamingStacClientLoggingMid.scala index 5f37b6ce..4b89891b 100644 --- a/stac-example/src/main/scala/geotrellis/server/ogc/stac/util/logging/StreamingStacClientLoggingMid.scala +++ b/stac-example/src/main/scala/geotrellis/server/ogc/stac/util/logging/StreamingStacClientLoggingMid.scala @@ -17,11 +17,12 @@ package geotrellis.server.ogc.stac.util.logging import cats.effect.Sync -import com.azavea.stac4s.api.client.{SearchFilters, StreamingStacClient, StreamingStacClientF} +import com.azavea.stac4s.api.client.{ETag, SearchFilters, StreamingStacClient, StreamingStacClientF} import com.azavea.stac4s.{StacCollection, StacItem} import eu.timepit.refined.types.string.NonEmptyString import fs2.Stream import io.chrisdavenport.log4cats.slf4j.Slf4jLogger +import io.circe.Json import io.circe.syntax._ import tofu.higherKind.Mid @@ -50,11 +51,17 @@ final class StreamingStacClientLoggingMid[F[_]: Sync] extends StreamingStacClien def collection(collectionId: NonEmptyString): F[StacCollection] = ??? - def item(collectionId: NonEmptyString, itemId: NonEmptyString): F[StacItem] = ??? + def collectionCreate(collection: StacCollection): F[StacCollection] = ??? - def itemCreate(collectionId: NonEmptyString, item: StacItem): F[StacItem] = ??? + def item(collectionId: NonEmptyString, itemId: NonEmptyString): F[ETag[StacItem]] = ??? - def collectionCreate(collection: StacCollection): F[StacCollection] = ??? + def itemCreate(collectionId: NonEmptyString, item: StacItem): F[ETag[StacItem]] = ??? + + def itemUpdate(collectionId: NonEmptyString, item: ETag[StacItem]): F[ETag[StacItem]] = ??? + + def itemPatch(collectionId: NonEmptyString, itemId: NonEmptyString, patch: ETag[Json]): F[ETag[StacItem]] = ??? + + def itemDelete(collectionId: NonEmptyString, itemId: NonEmptyString): F[Either[String, String]] = ??? } object StreamingStacClientLoggingMid {