Skip to content

Commit

Permalink
Bump GeoTools version up to 31.0 (#3521)
Browse files Browse the repository at this point in the history
* Bump GeoTools version up to 30.x-SNAPSHOT

* Move to JDK11 builds only

* Bump SBT version up

* Exclude log4j out of deps

* Bump geotools version up to 30-RC

* Update GeoTools up to 31.0
  • Loading branch information
pomadchin committed May 11, 2024
1 parent 340f245 commit 6df30b9
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 59 deletions.
16 changes: 0 additions & 16 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,6 @@ services:
- HBASE_DOCKER_HOSTNAME=localhost
network_mode: host

test-jdk8:
image: quay.io/azavea/openjdk-gdal:3.1-jdk8-slim
working_dir: /usr/local/src
command: ./sbt ++$SCALA_VERSION test
environment:
- CI
- SCALA_VERSION
depends_on:
- nginx
- minio
- cassandra
- hbase
volumes:
- ./../:/usr/local/src
network_mode: host

test-jdk11:
image: quay.io/azavea/openjdk-gdal:3.1-jdk11-slim
working_dir: /usr/local/src
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
scala: ["2.12.18", "2.13.12"]
java: ["8", "11"]
java: ["11"]
runs-on: ubuntu-latest

env:
Expand All @@ -32,11 +32,7 @@ jobs:

- name: run tests
run: |
if [[ "$JAVA_VERSION" == "8" ]]; then
docker compose -f .github/docker-compose.yml up test-jdk8 --abort-on-container-exit --exit-code-from test-jdk8
elif [[ "$JAVA_VERSION" == "11" ]]; then
docker compose -f .github/docker-compose.yml up test-jdk11 --abort-on-container-exit --exit-code-from test-jdk11
fi
docker compose -f .github/docker-compose.yml up test-jdk11 --abort-on-container-exit --exit-code-from test-jdk11
publish:
name: Publish Artifacts
Expand All @@ -45,7 +41,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [8]
java: [11]
distribution: [temurin]
runs-on: ${{ matrix.os }}
steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- 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
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ package geotrellis.geotools
import geotrellis.proj4.CRS
import geotrellis.util.MethodExtensions
import geotrellis.vector._

import org.opengis.feature.simple.SimpleFeature
import org.geotools.api.feature.simple.SimpleFeature

trait FeatureToSimpleFeatureMethods[G <: Geometry, T] extends MethodExtensions[Feature[G, T]] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ package geotrellis.geotools

import geotrellis.vector._
import geotrellis.proj4.CRS

import org.geotools.feature.simple.{SimpleFeatureTypeBuilder, SimpleFeatureBuilder}
import org.opengis.feature.simple.SimpleFeature
import org.geotools.api.feature.simple.SimpleFeature
import org.geotools.feature.simple.{SimpleFeatureBuilder, SimpleFeatureTypeBuilder}

object GeometryToSimpleFeature {
val geometryField = "the_geom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import geotrellis.proj4._
import geotrellis.util.MethodExtensions
import geotrellis.vector._

import org.opengis.feature.simple.SimpleFeature
import org.geotools.api.feature.simple.SimpleFeature

trait GeometryToSimpleFeatureMethods[G <: Geometry] extends MethodExtensions[G] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ import geotrellis.proj4.CRS
import geotrellis.raster._
import geotrellis.raster.io.geotiff.util._
import geotrellis.vector.Extent

import it.geosolutions.imageio.utilities.ImageIOUtilities
import org.geotools.coverage.Category
import org.geotools.coverage.GridSampleDimension
import org.geotools.coverage.grid._
import org.geotools.geometry.Envelope2D
import org.geotools.referencing.{CRS => GeoToolsCRS}
import org.geotools.coverage.util.CoverageUtilities
import org.geotools.util.NumberRange
import org.opengis.coverage.SampleDimensionType
import org.opengis.referencing.crs.CoordinateReferenceSystem
import org.geotools.geometry.jts.ReferencedEnvelope
import org.geotools.api.coverage._
import org.geotools.api.referencing.crs.CoordinateReferenceSystem
import spire.syntax.cfor._

import java.awt.Color
Expand Down Expand Up @@ -198,18 +197,18 @@ object GridCoverage2DConverters {
}

/**
* A function to produce a GeoTools Envelope2D from a Geotrellis
* A function to produce a GeoTools ReferencedEnvelope from a Geotrellis
* Extent and CRS.
*
* @param extent The Geotrellis Extent
* @param crs The CRS of the raster
*
* @return A GeoTools Envelope2D
* @return A GeoTools ReferencedEnvelope
*/
def getEnvelope2D(extent: Extent): Envelope2D = {
def getEnvelope2D(extent: Extent): ReferencedEnvelope = {
val Extent(xmin, ymin, xmax, ymax) = extent

new Envelope2D(null, xmin, ymin, (xmax - xmin), (ymax - ymin))
ReferencedEnvelope.rect(xmin, ymin, xmax - xmin, ymax - ymin, null)
}

def getGeotoolsCRS(crs: CRS): CoordinateReferenceSystem = {
Expand All @@ -222,20 +221,20 @@ object GridCoverage2DConverters {
}

/**
* A function to produce a GeoTools Envelope2D from a Geotrellis
* A function to produce a GeoTools ReferencedEnvelope from a Geotrellis
* Extent and CRS. If the CRS cannot be converted, a null GeoTools
* CRS is used.
*
* @param extent The Geotrellis Extent
* @param crs The CRS of the raster
*
* @return A GeoTools Envelope2D
* @return A GeoTools ReferencedEnvelope
*/
def getEnvelope2D(extent: Extent, crs: CRS): Envelope2D = {
def getEnvelope2D(extent: Extent, crs: CRS): ReferencedEnvelope = {
val Extent(xmin, ymin, xmax, ymax) = extent
val geoToolsCRS = getGeotoolsCRS(crs)

new Envelope2D(geoToolsCRS, xmin, ymin, (xmax - xmin), (ymax - ymin))
ReferencedEnvelope.rect(xmin, ymin, xmax - xmin, ymax - ymin, geoToolsCRS)
}

def getValueRange(cellType: CellType): (Double, Double) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package geotrellis.geotools

import geotrellis.vector._
import org.opengis.feature.simple.SimpleFeature
import org.geotools.api.feature.simple.SimpleFeature

import scala.collection._
import scala.collection.JavaConverters._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ package geotrellis.geotools

import geotrellis.util.MethodExtensions
import geotrellis.vector._

import org.opengis.feature.simple.SimpleFeature
import org.geotools.api.feature.simple.SimpleFeature

import scala.reflect.ClassTag

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package geotrellis.geotools
import geotrellis.util.MethodExtensions
import geotrellis.vector._

import org.opengis.feature.simple.SimpleFeature
import org.geotools.api.feature.simple.SimpleFeature

import scala.reflect.ClassTag

Expand Down
2 changes: 1 addition & 1 deletion geotools/src/main/scala/geotrellis/geotools/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import geotrellis.raster._
import geotrellis.util.MethodExtensions
import geotrellis.vector._

import org.geotools.api.feature.simple.SimpleFeature
import org.geotools.coverage.grid.GridCoverage2D
import org.opengis.feature.simple.SimpleFeature

package object geotools {
implicit class withSinglebandRasterToGridCoverage2DMethods(val self: Raster[Tile]) extends MethodExtensions[Raster[Tile]]
Expand Down
3 changes: 1 addition & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sbt._

object Version {
val geotools = "25.4"
val geotools = "31.0"
val spire = "0.17.0"
val accumulo = "1.10.4"
val cassandra = "4.17.0"
Expand Down Expand Up @@ -106,7 +106,6 @@ object Dependencies {
val geotoolsGeoTiff = "org.geotools" % "gt-geotiff" % Version.geotools
val geotoolsShapefile = "org.geotools" % "gt-shapefile" % Version.geotools
val geotoolsMetadata = "org.geotools" % "gt-metadata" % Version.geotools
val geotoolsOpengis = "org.geotools" % "gt-opengis" % Version.geotools

val scalaArm = "com.jsuereth" %% "scala-arm" % "2.0"

Expand Down
17 changes: 9 additions & 8 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ object Settings {
val apacheSnapshots = "apache-snapshots" at "https://repository.apache.org/content/repositories/snapshots/"
val eclipseReleases = "eclipse-releases" at "https://repo.eclipse.org/content/groups/releases"
val osgeoReleases = "osgeo-releases" at "https://repo.osgeo.org/repository/release/"
val osgeoSnapshots = "osgeo-snapshots" at "https://repo.osgeo.org/repository/snapshot/"
val geosolutions = "geosolutions" at "https://maven.geo-solutions.it/"
val jitpack = "jitpack" at "https://jitpack.io" // for https://github.com/everit-org/json-schema
val ivy2Local = Resolver.file("local", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.ivyStylePatterns)
val mavenLocal = Resolver.mavenLocal
val maven = DefaultMavenRepository
val local = Seq(ivy2Local, mavenLocal)
val external = Seq(osgeoReleases, maven, eclipseReleases, geosolutions, jitpack, apacheSnapshots)
val external = Seq(osgeoReleases, maven, eclipseReleases, geosolutions, jitpack, apacheSnapshots, osgeoSnapshots)
val all = external ++ local
}

Expand Down Expand Up @@ -289,8 +290,7 @@ object Settings {
geotoolsHsql,
geotoolsMain,
geotoolsReferencing,
geotoolsMetadata,
geotoolsOpengis
geotoolsMetadata
).map(_ excludeAll(excludedDependencies: _*)),
libraryDependencies ++= Seq(
unitApi,
Expand All @@ -313,11 +313,13 @@ object Settings {

lazy val hbase = Seq(
name := "geotrellis-hbase",
libraryDependencies +=
libraryDependencies ++= Seq(
hbaseMapReduce
exclude("javax.servlet", "servlet-api")
exclude("org.mortbay.jetty", "servlet-api-2.5"),
libraryDependencies += jacksonCoreAsl,
exclude("org.mortbay.jetty", "servlet-api-2.5")
exclude("log4j", "log4j"), // CVE-2021-4104, CVE-2020-8908
jacksonCoreAsl
),
console / initialCommands :=
"""
import geotrellis.raster._
Expand Down Expand Up @@ -465,7 +467,6 @@ object Settings {
name := "geotrellis-shapefile",
libraryDependencies ++= Seq(
geotoolsMain,
geotoolsOpengis,
geotoolsShapefile
).map(_ excludeAll(excludedDependencies: _*)),
libraryDependencies ++= Seq(scalatest % Test) ++ worksWithDependencies,
Expand Down Expand Up @@ -611,7 +612,7 @@ object Settings {
apacheIO,
scaffeine,
caffeine,
uzaygezenCore exclude("log4j", "log4j"),
uzaygezenCore exclude("log4j", "log4j"), // CVE-2021-4104, CVE-2020-8908
scalaXml,
apacheLang3,
fs2("core").value,
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.7
sbt.version=1.10.0
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
package geotrellis.shapefile

import geotrellis.vector._

import org.geotools.api.feature.simple.SimpleFeature
import org.geotools.data.simple._
import org.opengis.feature.simple._
import org.geotools.data.shapefile._

import java.net.URL
Expand Down

0 comments on commit 6df30b9

Please sign in to comment.