Skip to content

Commit

Permalink
Merge branch 'master' into upd/geotools
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin authored May 6, 2024
2 parents 70dc4d5 + 340f245 commit 064e241
Show file tree
Hide file tree
Showing 11 changed files with 265 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Build and Test
strategy:
matrix:
scala: ["2.12.17", "2.13.10"]
scala: ["2.12.19", "2.13.12"]
java: ["11"]
runs-on: ubuntu-latest

Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.7.1] - 2024-01-08

### Added
- Add JDK11 cross compilation [#3435](https://github.com/locationtech/geotrellis/pull/3435)

### Changed
- Fix FileRangeReaderProvider parsing URI in windows [#3507](https://github.com/locationtech/geotrellis/pull/3507)
- Regrid: force crop to avoid going out of memory [#3518](https://github.com/locationtech/geotrellis/pull/3518)
- Fix rounding errors/numerical instability in GridExtent and LayoutTileSource [#3520](https://github.com/locationtech/geotrellis/pull/3520)
- GeoTrellisPath.parse should preserve unrecognized uri parameters [#3529](https://github.com/locationtech/geotrellis/pull/3529)
- Bump GeoTools version up to 30.x [#3521](https://github.com/locationtech/geotrellis/pull/3521)

## [3.7.0] - 2023-02-26
Expand Down Expand Up @@ -1181,7 +1184,8 @@ efficiently using the layer query API.
the slick scala database library.
- Perform PostGIS `ST_` operations in PostGIS through scala.

[Unreleased]: https://github.com/locationtech/geotrellis/compare/v3.7.0...HEAD
[Unreleased]: https://github.com/locationtech/geotrellis/compare/v3.7.1...HEAD
[3.7.1]: https://github.com/locationtech/geotrellis/compare/v3.7.0...v3.7.1
[3.7.0]: https://github.com/locationtech/geotrellis/compare/v3.6.3...v3.7.0
[3.6.3]: https://github.com/locationtech/geotrellis/compare/v3.6.2...v3.6.3
[3.6.2]: https://github.com/locationtech/geotrellis/compare/v3.6.1...v3.6.2
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sbt.Keys._

ThisBuild / versionScheme := Some("semver-spec")
ThisBuild / scalaVersion := "2.13.10"
ThisBuild / scalaVersion := "2.13.12"
ThisBuild / organization := "org.locationtech.geotrellis"
ThisBuild / crossScalaVersions := List("2.12.17", "2.13.10")
ThisBuild / crossScalaVersions := List("2.12.18", "2.13.12")

lazy val root = Project("geotrellis", file("."))
.aggregate(
Expand Down
39 changes: 20 additions & 19 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import sbt._
object Version {
val geotools = "30-RC"
val spire = "0.17.0"
val accumulo = "1.10.3"
val cassandra = "4.15.0"
val hbase = "2.5.4"
val accumulo = "1.10.4"
val cassandra = "4.17.0"
val hbase = "2.5.7"
val hadoop = "3.3.6"
val gdal = "3.1.0"
val gdalWarp = "1.2.0"
Expand All @@ -45,46 +45,47 @@ object Dependencies {

def cats(module: String) = Def.setting {
module match {
case "effect" => "org.typelevel" %% s"cats-$module" % "3.5.0"
case _ => "org.typelevel" %% s"cats-$module" % "2.9.0"
case "effect" => "org.typelevel" %% s"cats-$module" % "3.5.2"
case _ => "org.typelevel" %% s"cats-$module" % "2.10.0"
}
}

def circe(module: String) = Def.setting {
module match {
case "json-schema" => "io.circe" %% s"circe-$module" % "0.2.0"
case _ => "io.circe" %% s"circe-$module" % "0.14.3"
case "json-schema" => "io.circe" %% s"circe-$module" % "0.2.0"
case "generic-extras" => "io.circe" %% s"circe-$module" % "0.14.3"
case _ => "io.circe" %% s"circe-$module" % "0.14.6"
}
}

def fs2(module: String) = Def.setting {
"co.fs2" %% s"fs2-$module" % "3.7.0"
"co.fs2" %% s"fs2-$module" % "3.9.3"
}

def apacheSpark(module: String) = Def.setting {
"org.apache.spark" %% s"spark-$module" % "3.4.0"
"org.apache.spark" %% s"spark-$module" % "3.5.0"
}

def scalaReflect(version: String) = "org.scala-lang" % "scala-reflect" % version

val pureconfig = "com.github.pureconfig" %% "pureconfig" % "0.17.4"
val log4s = "org.log4s" %% "log4s" % "1.10.0"
val scalatest = "org.scalatest" %% "scalatest" % "3.2.16"
val scalatest = "org.scalatest" %% "scalatest" % "3.2.17"
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.17.0"
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "2.1.0"
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "2.2.0"
val jts = "org.locationtech.jts" % "jts-core" % "1.19.0"
val proj4j = "org.locationtech.proj4j" % "proj4j" % "1.3.0"
val proj4jEPSG = "org.locationtech.proj4j" % "proj4j-epsg" % "1.3.0"
val openCSV = "com.opencsv" % "opencsv" % "5.7.1"
val openCSV = "com.opencsv" % "opencsv" % "5.9"
val spire = "org.typelevel" %% "spire" % Version.spire
val spireMacro = "org.typelevel" %% "spire-macros" % Version.spire
val apacheIO = "commons-io" % "commons-io" % "2.12.0"
val apacheLang3 = "org.apache.commons" % "commons-lang3" % "3.12.0"
val apacheIO = "commons-io" % "commons-io" % "2.15.1"
val apacheLang3 = "org.apache.commons" % "commons-lang3" % "3.14.0"
val apacheMath = "org.apache.commons" % "commons-math3" % "3.6.1"
val chronoscala = "jp.ne.opt" %% "chronoscala" % "1.0.0"
val awsSdkS3 = "software.amazon.awssdk" % "s3" % "2.20.77"
val awsSdkS3 = "software.amazon.awssdk" % "s3" % "2.22.12"
val hadoopClient = "org.apache.hadoop" % "hadoop-client" % Version.hadoop
val avro = "org.apache.avro" % "avro" % "1.11.1" // aligned with the Spark version
val avro = "org.apache.avro" % "avro" % "1.11.2" // aligned with the Spark version
val parserCombinators = "org.scala-lang.modules" %% "scala-parser-combinators" % "2.3.0"
val jsonSchemaValidator = "com.networknt" % "json-schema-validator" % "0.1.23"
val accumuloCore = "org.apache.accumulo" % "accumulo-core" % Version.accumulo
Expand Down Expand Up @@ -114,7 +115,7 @@ object Dependencies {
val hbaseMapReduce = "org.apache.hbase" % "hbase-mapreduce" % Version.hbase

val woodstoxCore = "com.fasterxml.woodstox" % "woodstox-core" % "6.5.1"
val stax2Api = "org.codehaus.woodstox" % "stax2-api" % "4.2.1"
val stax2Api = "org.codehaus.woodstox" % "stax2-api" % "4.2.2"
val commonsConfiguration2 = "org.apache.commons" % "commons-configuration2" % "2.9.0"
val re2j = "com.google.re2j" % "re2j" % "1.7"

Expand All @@ -126,10 +127,10 @@ object Dependencies {

val scalapbRuntime = "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion
val scalapbLenses = "com.thesamet.scalapb" %% "lenses" % scalapb.compiler.Version.scalapbVersion
val protobufJava = "com.google.protobuf" % "protobuf-java" % "3.23.2"
val protobufJava = "com.google.protobuf" % "protobuf-java" % "3.25.1"

val squants = "org.typelevel" %% "squants" % "1.8.3"
val scalactic = "org.scalactic" %% "scalactic" % "3.2.16"
val scalactic = "org.scalactic" %% "scalactic" % "3.2.17"

val gdalBindings = "org.gdal" % "gdal" % Version.gdal
val gdalWarp = "com.azavea.geotrellis" % "gdal-warp-bindings" % Version.gdalWarp
Expand Down
2 changes: 1 addition & 1 deletion project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ object Settings {
).filter(_.asFile.canRead).map(Credentials(_)),

addCompilerPlugin("org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full),
addCompilerPlugin("org.scalameta" % "semanticdb-scalac" % "4.7.8" cross CrossVersion.full),
addCompilerPlugin("org.scalameta" % "semanticdb-scalac" % "4.8.15" cross CrossVersion.full),

libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Nil
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.6
sbt.version=1.9.9
12 changes: 6 additions & 6 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
resolvers += sbt.Resolver.bintrayIvyRepo("typesafe", "sbt-plugins")

addDependencyTreePlugin
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.5")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.9.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.2")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.2")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.7" )
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2" )
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.13"
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.14"
6 changes: 3 additions & 3 deletions sbt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@

set -o pipefail

declare -r sbt_release_version="1.9.4"
declare -r sbt_unreleased_version="1.9.4"
declare -r sbt_release_version="1.9.7"
declare -r sbt_unreleased_version="1.9.7"

declare -r latest_213="2.13.11"
declare -r latest_213="2.13.12"
declare -r latest_212="2.12.18"
declare -r latest_211="2.11.12"
declare -r latest_210="2.10.7"
Expand Down
19 changes: 12 additions & 7 deletions store/src/main/scala/geotrellis/store/GeoTrellisPath.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ object GeoTrellisPath {
implicit def toGeoTrellisDataPath(path: String): GeoTrellisPath = parse(path)

def parseOption(path: String): Option[GeoTrellisPath] = {
val layerNameParam: String = "layer"
val zoomLevelParam: String = "zoom"
val bandCountParam: String = "band_count"
val layerNameParam = "layer"
val zoomLevelParam = "zoom"
val bandCountParam = "band_count"

val uri = UrlWithAuthority.parseOption(path).fold(Url.parse(path))(identity)
val queryString = uri.query
Expand All @@ -70,13 +70,18 @@ object GeoTrellisPath {
case _ => ""
}

s"${scheme.split("\\+").last}://$authority${uri.path}".some
val queryStringFiltered = {
val filtered = queryString.removeAll(layerNameParam, zoomLevelParam, bandCountParam)
if(filtered.isEmpty) "" else s"?${filtered.toString()}"
}

s"${scheme.split("\\+").last}://$authority${uri.path}$queryStringFiltered".trim.some
}

catalogPath.fold(Option.empty[GeoTrellisPath]) { catalogPath =>
val maybeLayerName: Option[String] = queryString.param(layerNameParam)
val maybeZoomLevel: Option[Int] = queryString.param(zoomLevelParam).map(_.toInt)
val bandCount: Option[Int] = queryString.param(bandCountParam).map(_.toInt)
val maybeLayerName = queryString.param(layerNameParam)
val maybeZoomLevel = queryString.param(zoomLevelParam).map(_.toInt)
val bandCount = queryString.param(bandCountParam).map(_.toInt)

(maybeLayerName, maybeZoomLevel) match {
case (Some(layerName), Some(zoomLevel)) =>
Expand Down
24 changes: 19 additions & 5 deletions store/src/test/scala/geotrellis/store/GeoTrellisPathSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class GeoTrellisPathSpec extends AnyFunSpec {

it("should fail to parse without a layer") {
val path = GeoTrellisPath.parseOption("file:///foo/bar?zoom=1")
assert(path == None)
assert(path.isEmpty)
}

it("should fail to parse without a zoom") {
val path = GeoTrellisPath.parseOption("file:///foo/bar?layer=baz")
assert(path == None)
assert(path.isEmpty)
}

it("should parse a local absolute file path without scheme") {
Expand Down Expand Up @@ -59,7 +59,7 @@ class GeoTrellisPathSpec extends AnyFunSpec {
val path = GeoTrellisPath.parse("file:///foo/bar?layer=baz&band_count=1&zoom=10")
assert(path.layerName == "baz")
assert(path.zoomLevel == 10)
assert(path.bandCount == Some(1))
assert(path.bandCount.contains(1))
}

it("should parse hdfs scheme") {
Expand All @@ -74,6 +74,20 @@ class GeoTrellisPathSpec extends AnyFunSpec {
assert(path.layerName == "foo")
}

it("should parse hbase scheme") {
val path = GeoTrellisPath.parse("hbase://zookeeper:2181?master=master_host&attributes=attributes_table&layers=layers_table&layer=foo&zoom=1")
assert(path.value == "hbase://zookeeper:2181?master=master_host&attributes=attributes_table&layers=layers_table")
assert(path.layerName == "foo")
assert(path.zoomLevel == 1)
}

it("should parse accumulo scheme") {
val path = GeoTrellisPath.parse("accumulo://root:@localhost/fake?attributes=attributes&layers=tiles&layer=foo&zoom=1")
assert(path.value == "accumulo://root:@localhost/fake?attributes=attributes&layers=tiles")
assert(path.layerName == "foo")
assert(path.zoomLevel == 1)
}

it("should parse absolute file scheme with gt+ prefix") {
val path = GeoTrellisPath.parse("gt+file:///absolute/path?layer=foo&zoom=1")
assert(path.value == "file:///absolute/path")
Expand All @@ -92,9 +106,9 @@ class GeoTrellisPathSpec extends AnyFunSpec {
assert(path.layerName == "foo")
}

it("should ignore invalid parameters") {
it("should not ignore invalid parameters") {
val path = GeoTrellisPath.parse("file:///foo/bar?layer=baz&zoom=1&invalid=not&nope=1")
assert(path == GeoTrellisPath("file:///foo/bar", "baz", 1, None))
assert(path == GeoTrellisPath("file:///foo/bar?invalid=not&nope=1", "baz", 1, None))
}
}
}
Loading

0 comments on commit 064e241

Please sign in to comment.