Skip to content

Commit

Permalink
Merge branch 'release/4.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Jun 23, 2020
2 parents 1772870 + 1763fb2 commit fbad253
Show file tree
Hide file tree
Showing 112 changed files with 6,693 additions and 1,132 deletions.
29 changes: 15 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ aliases:
key: sbt-cache-{{ checksum "/tmp/scala_version" }}-{{ epoch }}
paths:
- "~/.ivy2/cache"
- "~/.sbt"
- "~/.cache/coursier"
- "~/.sbt"
- "~/.m2"

- &run_cibuild
- checkout
Expand All @@ -25,10 +26,10 @@ aliases:
- run:
name: "Import signing key"
command: |
gpg --keyserver keyserver.ubuntu.com \
--recv-keys 0x13E9AA1D8153E95E && \
echo "${GPG_KEY}" | base64 -d > signing_key.asc && \
gpg --batch \
--passphrase "${GPG_PASSPHRASE}" \
--import signing_key.asc
gpg --import signing_key.asc
- run:
name: Executing cipublish
command: ./scripts/cipublish
Expand All @@ -40,11 +41,11 @@ aliases:
environment:
SCALA_VERSION: 2.11.12

- &openjdk8-scala2_12_8_environment
- &openjdk8-scala2_12_11_environment
docker:
- image: circleci/openjdk:8-jdk
environment:
SCALA_VERSION: 2.12.10
SCALA_VERSION: 2.12.11

version: 2
workflows:
Expand All @@ -56,8 +57,8 @@ workflows:
tags:
only:
- /^(.*)$/
- "openjdk8-scala2.12.10":
filters: # required since `openjdk8-scala2.12.10_deploy` has tag filters AND requires `openjdk8-scala2.12.10`
- "openjdk8-scala2.12.11":
filters: # required since `openjdk8-scala2.12.11_deploy` has tag filters AND requires `openjdk8-scala2.12.11`
tags:
only:
- /^(.*)$/
Expand All @@ -73,9 +74,9 @@ workflows:
- develop
- /release\/.*/
- /hotfix\/.*/
- "openjdk8-scala2.12.10_deploy":
- "openjdk8-scala2.12.11_deploy":
requires:
- "openjdk8-scala2.12.10"
- "openjdk8-scala2.12.11"
filters:
tags:
only:
Expand All @@ -91,14 +92,14 @@ jobs:
<<: *openjdk8-scala2_11_12_environment
steps: *run_cibuild

"openjdk8-scala2.12.10":
<<: *openjdk8-scala2_12_8_environment
"openjdk8-scala2.12.11":
<<: *openjdk8-scala2_12_11_environment
steps: *run_cibuild

"openjdk8-scala2.11.12_deploy":
<<: *openjdk8-scala2_11_12_environment
steps: *run_cipublish

"openjdk8-scala2.12.10_deploy":
<<: *openjdk8-scala2_12_8_environment
"openjdk8-scala2.12.11_deploy":
<<: *openjdk8-scala2_12_11_environment
steps: *run_cipublish
2 changes: 1 addition & 1 deletion .sbtopts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-J-Xmx2G
-J-Xms1G
-J-Xss2M
-J-Xss5M
-Djava.awt.headless=true
-Dsbt.color=always
-Dsbt.supershell=false
39 changes: 38 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.2.0] - 2020-06-23

### Added
- Configurable ResampleMethod in source definitions [#229](https://github.com/geotrellis/geotrellis-server/issues/229)
- Enable TargetCell parameter for focal operations [#212](https://github.com/geotrellis/geotrellis-server/issues/212)
- WMS Extended capabilities and operations [#235](https://github.com/geotrellis/geotrellis-server/issues/235)
- WCS GetCapabilities user defined parameters [#237](https://github.com/geotrellis/geotrellis-server/issues/237)
- WMS GetMap support of extended parameters [#236](https://github.com/geotrellis/geotrellis-server/issues/236)
- WCS GetCoverage support of extended parameters [#238](https://github.com/geotrellis/geotrellis-server/issues/238)
- ColorRampStyle.clampWithColor option to render colors outside the requested render range as colors in the ramp instead of as transparent pixels [#220](https://github.com/geotrellis/geotrellis-server/issues/220)
- Expose overview strategy into the layers configuration [#252](https://github.com/geotrellis/geotrellis-server/pull/252)
- RGB styling configuration [#249](https://github.com/geotrellis/geotrellis-server/issues/249)
- Add STAC Support [#263](https://github.com/geotrellis/geotrellis-server/pull/263)
- Fix ExtentRefication, wcs and wms default behavior when time is not specified for temporal layers [#278](https://github.com/geotrellis/geotrellis-server/pull/278)
- Expose STAC temporal metadata [#279](https://github.com/geotrellis/geotrellis-server/pull/279)
- Support for Time lists in WMS GetCapabilities [#259](https://github.com/geotrellis/geotrellis-server/issues/259)
- Default attribute should not be used to serve response inside Time extent [#260](https://github.com/geotrellis/geotrellis-server/issues/260)
- Enabling Time Dimension for mapalgebrasourceconf on Temporal Layers [#262](https://github.com/geotrellis/geotrellis-server/issues/262)

### Changed

- The `layers.layer-name.sources` field in application.conf is renamed to `source` and now supports a single RasterSource URI string. See `ogc-example/src/main/resources/application.conf` for examples.
- `type = "simplesourceconf"` should be changed to `type = "rastersourceconf"` in application.conf
- Remove GeoTrellisRasterSourceLegacy [#197](https://github.com/geotrellis/geotrellis-server/issues/197)
- Receive GPG key while publishing artifacts [#271](https://github.com/geotrellis/geotrellis-server/pull/271)

### Fixed

- Addressed GeoTrellisRasterSourceLegacy issues and minimized number of RasterSource instances constructed for GeoTrellis Layers [#219](https://github.com/geotrellis/geotrellis-server/issues/219)
- Some source resolutions are sometimes skipped leading to reading too much tiles [#215](https://github.com/geotrellis/geotrellis-server/issues/215)
- LayerHistogram should select the CellSize large enough to compute the histogram [#261](https://github.com/geotrellis/geotrellis-server/pull/261)

## [4.1.0] - 2020-03-03

### Added
Expand All @@ -15,8 +47,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- RasterSource Catalog [#162](https://github.com/geotrellis/geotrellis-server/issues/162)
- {WCS|WMTS|WMS}Model uses RasterSource catalog [#163](https://github.com/geotrellis/geotrellis-server/issues/163)
- WCS DescribeCoverage may include time TemporalDomain [#211](https://github.com/geotrellis/geotrellis-server/issues/211)
- WCS GetCoverage may include time param `TIMESEQUENCE` [#157](https://github.com/geotrellis/geotrellis-server/issues/157)
- WMS GetCapabilities may include time TemporalDomain [#185](https://github.com/geotrellis/geotrellis-server/issues/185)
- WMS GetMap may include time param `TIME` [#175](https://github.com/geotrellis/geotrellis-server/issues/175)

### Changed
- GT Server sources are now loaded via the GeoTrellis RasterSource SPI API. Each `sources` definition in your application.conf should be migrated to a list of [valid RasterSource SPI URIs](https://github.com/geotrellis/geotrellis-server/pull/222/commits/5937bf6022ba192eb8ab3a7cf28c6b08738fc56a) [#222](https://github.com/geotrellis/geotrellis-server/pull/222)
- Included split dependencies a la GeoTrellis 3.2 for cats ecosystem libraries [\#184](https://github.com/geotrellis/geotrellis-server/pull/184)
- Dropped WCS 1.0.0 support
- Updated MAML up to 0.6.0 [#199](https://github.com/geotrellis/geotrellis-server/pull/199)
Expand Down Expand Up @@ -64,7 +100,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Update geotrellis-contrib [#135](https://github.com/geotrellis/geotrellis-server/pull/135)

[Unreleased]: https://github.com/geotrellis/geotrellis-server/compare/4.1.0...HEAD
[Unreleased]: https://github.com/geotrellis/geotrellis-server/compare/4.2.0...HEAD
[4.2.0]: https://github.com/geotrellis/geotrellis-server/compare/4.2.0...4.1.0
[4.1.0]: https://github.com/geotrellis/geotrellis-server/compare/4.0.1...4.1.0
[4.0.1]: https://github.com/geotrellis/geotrellis-server/compare/4.0.0...4.0.1
[4.0.0]: https://github.com/geotrellis/geotrellis-server/compare/3.4.0...4.0.0
Expand Down
70 changes: 50 additions & 20 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ lazy val commonSettings = Seq(
// only appends the `-SNAPSHOT` suffix if there are uncommitted
// changes in the workspace.
version := {
// Avoid Cyclic reference involving error
if (git.gitCurrentTags.value.isEmpty || git.gitUncommittedChanges.value)
if (git.gitHeadCommit.value.isEmpty) "0.0.1-SNAPSHOT"
else if (git.gitDescribedVersion.value.isEmpty)
git.gitHeadCommit.value.get.substring(0, 7) + "-SNAPSHOT"
else if (git.gitCurrentTags.value.isEmpty || git.gitUncommittedChanges.value)
git.gitDescribedVersion.value.get + "-SNAPSHOT"
else
git.gitDescribedVersion.value.get
Expand Down Expand Up @@ -43,9 +45,10 @@ lazy val commonSettings = Seq(
Resolver.bintrayRepo("azavea", "geotrellis"),
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots"),
"osgeo" at "https://download.osgeo.org/webdav/geotools/",
"locationtech-releases" at "https://repo.locationtech.org/content/groups/releases",
"locationtech-snapshots" at "https://repo.locationtech.org/content/groups/snapshots"
"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"
),
addCompilerPlugin(kindProjector cross CrossVersion.full),
addCompilerPlugin(macrosParadise cross CrossVersion.full),
Expand Down Expand Up @@ -77,11 +80,6 @@ lazy val commonSettings = Seq(
headerLicense := Some(HeaderLicense.ALv2(java.time.Year.now.getValue.toString, "Azavea")),
headerMappings := Map(
FileType.scala -> CommentStyle.cStyleBlockComment.copy(commentCreator = new CommentCreator() {
val Pattern = "(?s).*?(\\d{4}(-\\d{4})?).*".r
def findYear(header: String): Option[String] = header match {
case Pattern(years, _) => Some(years)
case _ => None
}
def apply(text: String, existingText: Option[String]): String = {
// preserve year of old headers
val newText = CommentStyle.cStyleBlockComment.commentCreator.apply(text, existingText)
Expand Down Expand Up @@ -165,7 +163,7 @@ lazy val root = project
.settings(commonSettings)
.settings(publishSettings)
.settings(noPublishSettings)
.aggregate(core, example, ogc, ogcExample, opengis, stac)
.aggregate(core, example, ogc, `ogc-example`, opengis, stac)

lazy val core = project
.settings(moduleName := "geotrellis-server-core")
Expand All @@ -180,8 +178,7 @@ lazy val core = project
circeOptics.value,
circeShapes.value,
geotrellisS3,
geotrellisSpark,
spark,
geotrellisStore,
cats.value,
catsEffect.value,
mamlJvm,
Expand Down Expand Up @@ -215,9 +212,8 @@ lazy val example = project
http4sXml.value,
scalaXml,
geotrellisS3,
geotrellisSpark,
geotrellisStore,
geotrellisGdal,
spark,
decline,
commonsIO,
concHashMap,
Expand Down Expand Up @@ -275,17 +271,16 @@ lazy val ogc = project
.settings(
assembly / assemblyJarName := "geotrellis-server-ogc.jar",
libraryDependencies ++= Seq(
spark,
geotrellisS3,
geotrellisSpark,
geotrellisStore,
commonsIo, // to make GeoTiffRasterSources work
scaffeine,
scalatest,
jaxbApi
)
)

lazy val ogcExample = (project in file("ogc-example"))
lazy val `ogc-example` = project
.dependsOn(ogc)
.enablePlugins(DockerPlugin)
.settings(moduleName := "geotrellis-server-ogc-example")
Expand All @@ -294,9 +289,8 @@ lazy val ogcExample = (project in file("ogc-example"))
.settings(
assembly / assemblyJarName := "geotrellis-server-ogc-services.jar",
libraryDependencies ++= Seq(
spark,
geotrellisS3,
geotrellisSpark,
geotrellisStore,
geotrellisCassandra,
geotrellisHBase,
geotrellisAccumulo,
Expand Down Expand Up @@ -349,6 +343,42 @@ lazy val stac = project
)
)

lazy val `stac-example` = project
.dependsOn(ogc)
.settings(moduleName := "geotrellis-stac-example")
.settings(commonSettings)
.settings(publishSettings)
.settings(crossScalaVersions := Seq(scalaVer))
.settings(libraryDependencies ++= Seq(
geotrellisGdal,
http4sDsl.value,
http4sBlazeServer.value,
http4sBlazeClient.value,
http4sCirce.value,
http4sXml.value,
logback,
pureConfig,
pureConfigCatsEffect,
scaffeine,
scalatest,
decline,
stac4s
),
excludeDependencies ++= Seq(
// log4j brought in via uzaygezen is a pain for us
ExclusionRule("log4j", "log4j"),
ExclusionRule("org.slf4j", "slf4j-log4j12"),
ExclusionRule("org.slf4j", "slf4j-nop")
),
assembly / assemblyJarName := "geotrellis-stac-example.jar",
libraryDependencies := (CrossVersion
.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor >= 12 =>
libraryDependencies.value ++ Seq(ansiColors212)
case Some((2, scalaMajor)) if scalaMajor >= 11 =>
libraryDependencies.value ++ Seq(ansiColors211)
}))

lazy val bench = project
.dependsOn(core)
.settings(commonSettings)
Expand Down
4 changes: 0 additions & 4 deletions core/src/main/scala/geotrellis/server/ExtentReification.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ package geotrellis.server

import geotrellis.raster.{ProjectedRaster, MultibandTile, CellSize}
import geotrellis.vector.Extent
import cats._
import cats.data.EitherT
import cats.effect._
import simulacrum._

import java.util.UUID


@typeclass trait ExtentReification[A] {
@op("extentReification") def extentReification(self: A)(implicit contextShift: ContextShift[IO]): (Extent, CellSize) => IO[ProjectedRaster[MultibandTile]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package geotrellis.server

import geotrellis.proj4.CRS
import geotrellis.raster.RasterExtent

import cats.data.{NonEmptyList => NEL}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/geotrellis/server/LayerHistogram.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ object LayerHistogram {
)
}
cellSize <- IO {
SampleUtils.chooseLargestCellSize(rasterExtents.map(_.cellSize))
SampleUtils.chooseLargestCellSize(rasterExtents, maxCells)
}
_ <- IO {
logger.trace(
Expand Down
24 changes: 15 additions & 9 deletions core/src/main/scala/geotrellis/server/extent/SampleUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ package geotrellis.server.extent

import geotrellis.vector.Extent
import geotrellis.raster._

import cats.data.{NonEmptyList => NEL}
import cats.effect._
import cats.implicits._
import cats.syntax.either._


object SampleUtils {
val logger = org.log4s.getLogger
Expand All @@ -48,6 +43,20 @@ object SampleUtils {
(tl, tr, bl, br)
}

/** Choose the largest cellsize with the minCells amount */
final def chooseLargestCellSize(rasterExtents: NEL[RasterExtent], minCells: Int): CellSize =
rasterExtents
.reduceLeft { (chosenRE: RasterExtent, nextRE: RasterExtent) =>
val (chosenCS, nextCS) = chosenRE.cellSize -> nextRE.cellSize
val chosenSize = chosenCS.height * chosenCS.width
val nextSize = nextCS.height * nextCS.width

if (nextSize > chosenSize && nextRE.size > minCells)
nextRE
else
chosenRE
}.cellSize

/** Choose the largest cellsize */
final def chooseLargestCellSize(nativeCellSizes: NEL[CellSize]): CellSize =
nativeCellSizes
Expand All @@ -74,16 +83,13 @@ object SampleUtils {
chosenCS
})

final def intersectExtents(extents: NEL[Extent]): Option[Extent] = {
final def intersectExtents(extents: NEL[Extent]): Option[Extent] =
extents.tail.foldLeft(Option(extents.head))({
case (Some(ex1), ex2) => ex1 intersection ex2
case _ => None
})
}

final def unionExtents(extents: NEL[Extent]): Option[Extent] =
Some(extents.tail.foldLeft(extents.head)({ (ex1, ex2) => ex1 combine ex2 }))


}

Loading

0 comments on commit fbad253

Please sign in to comment.