This is an automated email from the ASF dual-hosted git repository.

jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git


The following commit(s) were added to refs/heads/master by this push:
     new e0aabe345 [SEDONA-551] Upgrade GeoTools dependency to 31.0 for Apache 
SIS integration and Drop Java 8 support (#1382)
e0aabe345 is described below

commit e0aabe3452cf192a731794372d281201063f37ec
Author: Jia Yu <[email protected]>
AuthorDate: Tue Apr 30 01:51:46 2024 -0700

    [SEDONA-551] Upgrade GeoTools dependency to 31.0 for Apache SIS integration 
and Drop Java 8 support (#1382)
    
    * Initial upgrade
    
    * Temporarily remove the check again R `release`
    
    * Fix failed python tests
    
    * Add geotools manually
    
    * Add 2 debug line
    
    * Try to fix the R tests
    
    * Don't run RS_NumBands and RS_Values on all the images, otherwise adding 
new
    images to raster directory will fail the tests.
    
    * Use Java 11 to build the docs
    
    * Revert "Try to fix the R tests"
    
    This reverts commit a1a44bfc48f4ebe9429f9a3d5bcb69de682c576d.
    
    * Only generate scala docs for spark/common module, since we cannot 
generate docs for
    non-scala module (such as commons) using Java 11.
    
    * Remove links to Javadoc. Change java versions in all docs to Java 11.
    
    * Stop compiling Javadoc since it does not work on Java 11
    
    * Compile source code first before running Scaladoc
    
    ---------
    
    Co-authored-by: Kristin Cowalcijk <[email protected]>
    Co-authored-by: Kristin Cowalcijk <[email protected]>
---
 .github/workflows/docs.yml                         |  8 +++---
 .github/workflows/java.yml                         | 20 +++++---------
 .github/workflows/python.yml                       |  2 +-
 .github/workflows/r.yml                            |  6 ++---
 R/tests/testthat/test-data-interface-raster.R      | 12 +++------
 .../apache/sedona/common/FunctionsGeoTools.java    | 10 +++----
 .../sedona/common/raster/GeometryFunctions.java    |  8 +++---
 .../sedona/common/raster/PixelFunctionEditors.java |  9 +++----
 .../sedona/common/raster/PixelFunctions.java       | 11 ++++----
 .../sedona/common/raster/RasterAccessors.java      |  8 +++---
 .../sedona/common/raster/RasterBandAccessors.java  |  2 +-
 .../sedona/common/raster/RasterBandEditors.java    |  6 ++---
 .../sedona/common/raster/RasterConstructors.java   | 28 +++++++++----------
 .../raster/RasterConstructorsForTesting.java       |  6 ++---
 .../apache/sedona/common/raster/RasterEditors.java | 22 +++++++--------
 .../apache/sedona/common/raster/RasterOutputs.java |  6 ++---
 .../sedona/common/raster/RasterPredicates.java     | 12 ++++-----
 .../sedona/common/raster/netcdf/NetCdfReader.java  |  4 +--
 .../sedona/common/raster/serde/CRSSerializer.java  |  4 +--
 .../apache/sedona/common/raster/serde/Serde.java   |  2 +-
 .../common/utils/CachedCRSTransformFinder.java     |  6 ++---
 .../apache/sedona/common/utils/RasterUtils.java    | 23 ++++++++--------
 .../org/apache/sedona/common/FunctionsTest.java    |  4 +--
 .../sedona/common/raster/FunctionEditorsTest.java  |  4 +--
 .../apache/sedona/common/raster/FunctionsTest.java |  4 +--
 .../common/raster/GeometryFunctionsTest.java       |  4 +--
 .../sedona/common/raster/MapAlgebraTest.java       |  2 +-
 .../sedona/common/raster/RasterAccessorsTest.java  |  4 +--
 .../common/raster/RasterBandAccessorsTest.java     |  4 +--
 .../common/raster/RasterBandEditorsTest.java       |  4 +--
 .../common/raster/RasterConstructorsTest.java      | 12 ++++-----
 .../sedona/common/raster/RasterEditorsTest.java    | 22 +++++++--------
 .../sedona/common/raster/RasterOutputTest.java     |  2 +-
 .../sedona/common/raster/RasterPredicatesTest.java |  8 +++---
 .../sedona/common/raster/RasterTestBase.java       | 31 +++++++++++-----------
 .../common/raster/serde/CRSSerializerTest.java     |  4 +--
 .../sedona/common/raster/serde/SerdeTest.java      |  2 +-
 docs/api/java-api.md                               |  2 +-
 docs/api/python-api.md                             |  1 -
 docs/api/viz/java-api.md                           |  2 +-
 docs/community/develop.md                          |  2 +-
 docs/community/release-manager.md                  | 14 +++++-----
 docs/community/vote.md                             |  2 +-
 docs/setup/cluster.md                              |  2 +-
 docs/setup/compile.md                              |  2 +-
 docs/setup/flink/platform.md                       |  2 +-
 docs/setup/platform.md                             |  2 +-
 docs/tutorial/demo.md                              |  2 +-
 .../apache/sedona/flink/expressions/Functions.java |  9 +++----
 .../flink/expressions/FunctionsGeoTools.java       |  4 +--
 .../java/org/apache/sedona/flink/FunctionTest.java |  4 +--
 mkdocs.yml                                         |  2 +-
 pom.xml                                            |  2 +-
 python/tests/sql/test_dataframe_api.py             |  2 +-
 .../sedona/snowflake/snowsql/GeoToolsWrapper.java  |  4 +--
 .../sedona/core/spatialOperator/KNNQuery.java      |  4 +--
 .../strategy/join/JoinedGeometryRaster.scala       | 11 ++++----
 .../shapefileParser/shapes/ShapefileRDDTest.java   | 12 ++++-----
 .../shapes/ShapefileReaderTest.java                | 14 +++++-----
 .../org/apache/sedona/sql/functionTestScala.scala  |  2 +-
 60 files changed, 204 insertions(+), 225 deletions(-)

diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index c5e6e7800..b1415266f 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -22,11 +22,11 @@ jobs:
       uses: actions/setup-java@v4
       with:
         distribution: 'zulu'
-        java-version: '8'
-    - name: Compile JavaDoc
-      run: mvn -q clean install -DskipTests && mkdir -p docs/api/javadoc/spark 
&& cp -r spark/common/target/apidocs/* docs/api/javadoc/spark/
+        java-version: '11'
+    - name: Compile Source Code
+      run: mvn -q clean install -DskipTests
     - name: Compile ScalaDoc
-      run: mvn scala:doc && mkdir -p docs/api/scaladoc/spark && cp -r 
spark/common/target/site/scaladocs/* docs/api/scaladoc/spark
+      run: mvn scala:doc -pl spark/common && mkdir -p docs/api/scaladoc/spark 
&& cp -r spark/common/target/site/scaladocs/* docs/api/scaladoc/spark
     - uses: actions/setup-python@v5
       with:
         python-version: 3.x
diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml
index 3d780c7ae..616e3e2d1 100644
--- a/.github/workflows/java.yml
+++ b/.github/workflows/java.yml
@@ -41,11 +41,7 @@ jobs:
         include:
           - spark: 3.5.0
             scala: 2.13.8
-            jdk: '8'
-            skipTests: ''
-          - spark: 3.5.0
-            scala: 2.12.15
-            jdk: '8'
+            jdk: '11'
             skipTests: ''
           - spark: 3.5.0
             scala: 2.12.15
@@ -53,11 +49,7 @@ jobs:
             skipTests: ''
           - spark: 3.4.0
             scala: 2.13.8
-            jdk: '8'
-            skipTests: ''
-          - spark: 3.4.0
-            scala: 2.12.15
-            jdk: '8'
+            jdk: '11'
             skipTests: ''
           - spark: 3.4.0
             scala: 2.12.15
@@ -65,19 +57,19 @@ jobs:
             skipTests: ''
           - spark: 3.3.0
             scala: 2.12.15
-            jdk: '8'
+            jdk: '11'
             skipTests: ''
           - spark: 3.2.3
             scala: 2.12.15
-            jdk: '8'
+            jdk: '11'
             skipTests: ''
           - spark: 3.1.2
             scala: 2.12.15
-            jdk: '8'
+            jdk: '11'
             skipTests: ''
           - spark: 3.0.3
             scala: 2.12.15
-            jdk: '8'
+            jdk: '11'
             skipTests: ''
 
     steps:
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index 9e5546677..a5d623dd5 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -97,7 +97,7 @@ jobs:
     - uses: actions/setup-java@v4
       with:
         distribution: 'zulu'
-        java-version: '8'
+        java-version: '11'
     - uses: actions/setup-python@v5
       with:
         python-version: ${{ matrix.python }}
diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml
index 199e03077..b917479cb 100644
--- a/.github/workflows/r.yml
+++ b/.github/workflows/r.yml
@@ -34,7 +34,7 @@ jobs:
         spark: [3.0.3, 3.1.2, 3.2.1, 3.3.0, 3.4.0, 3.5.0]
         hadoop: [3]
         scala: [2.12.15]
-        r: [oldrel, release]
+        r: [oldrel]
 
     env:
       SPARK_VERSION: ${{ matrix.spark }}
@@ -86,7 +86,7 @@ jobs:
       - uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: '8'
+          java-version: '11'
           cache: 'maven'
       - name: Get OS name
         id: os-name
@@ -106,7 +106,7 @@ jobs:
           if [ ${SPARK_VERSION:2:1} -gt "3" ]; then
             SPARK_COMPAT_VERSION=${SPARK_VERSION:0:3}
           fi
-          mvn -q clean install -DskipTests -Dspark=${SPARK_COMPAT_VERSION} 
-Dscala=${SCALA_VERSION:0:4}
+          mvn -q clean install -DskipTests -Dspark=${SPARK_COMPAT_VERSION} 
-Dscala=${SCALA_VERSION:0:4} -Dgeotools
       - name: Run tests
         run: |
           if [[ "${SPARK_VERSION:0:3}" < "3.3" ]]; then
diff --git a/R/tests/testthat/test-data-interface-raster.R 
b/R/tests/testthat/test-data-interface-raster.R
index 6bfd53b2a..7290c5850 100644
--- a/R/tests/testthat/test-data-interface-raster.R
+++ b/R/tests/testthat/test-data-interface-raster.R
@@ -132,7 +132,7 @@ test_that("Passed RS_Envelope with raster", {
 test_that("Passed RS_NumBands with raster", {
   ## Load
   sdf_name <- random_string("spatial_sdf")
-  binary_sdf <- spark_read_binary(sc, dir = test_data("raster"), name = 
sdf_name)
+  binary_sdf <- spark_read_binary(sc, dir = test_data("raster/test3.tif"), 
name = sdf_name)
 
   a <-
     binary_sdf %>%
@@ -142,14 +142,11 @@ test_that("Passed RS_NumBands with raster", {
     ) %>%
     select(nbands) %>%
     collect()
-
   expect_equal(
     a %>% as.list(),
-    list(nbands = c(1, 1, 4))
-
+    list(nbands = c(4))
   )
 
-
   ## Cleanup
   sc %>% DBI::dbExecute(paste0("DROP TABLE ", sdf_name))
   rm(a)
@@ -185,7 +182,7 @@ test_that("Passed RS_Value with raster", {
 test_that("Passed RS_Values with raster", {
   ## Load
   sdf_name <- random_string("spatial_sdf")
-  binary_sdf <- spark_read_binary(sc, dir = test_data("raster"), name = 
sdf_name)
+  binary_sdf <- spark_read_binary(sc, dir = test_data("raster/test1.tiff"), 
name = sdf_name)
 
   a <-
     binary_sdf %>%
@@ -195,10 +192,9 @@ test_that("Passed RS_Values with raster", {
     ) %>%
     select(val) %>%
     collect()
-
   expect_equal(
     a %>% as.list(),
-    list(val = list(c(255, NA_real_), c(255, NA_real_), c(NA_real_, NA_real_)))
+    list(val = list(c(255, NA_real_)))
 
   )
 
diff --git 
a/common/src/main/java/org/apache/sedona/common/FunctionsGeoTools.java 
b/common/src/main/java/org/apache/sedona/common/FunctionsGeoTools.java
index b47c5ce8f..4b15a639c 100644
--- a/common/src/main/java/org/apache/sedona/common/FunctionsGeoTools.java
+++ b/common/src/main/java/org/apache/sedona/common/FunctionsGeoTools.java
@@ -23,11 +23,11 @@ import org.locationtech.jts.geom.GeometryFactory;
 import org.locationtech.jts.operation.buffer.BufferOp;
 import org.locationtech.jts.operation.buffer.BufferParameters;
 import org.locationtech.jts.triangulate.VoronoiDiagramBuilder;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.NoSuchAuthorityCodeException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.NoSuchAuthorityCodeException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.MathTransform;
+import org.geotools.api.referencing.operation.TransformException;
 
 
 
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/GeometryFunctions.java 
b/common/src/main/java/org/apache/sedona/common/raster/GeometryFunctions.java
index a2c91fbd8..ff215776c 100644
--- 
a/common/src/main/java/org/apache/sedona/common/raster/GeometryFunctions.java
+++ 
b/common/src/main/java/org/apache/sedona/common/raster/GeometryFunctions.java
@@ -22,11 +22,11 @@ package org.apache.sedona.common.raster;
 import org.apache.sedona.common.utils.RasterUtils;
 import org.geotools.coverage.grid.GridCoordinates2D;
 import org.geotools.coverage.grid.GridCoverage2D;
-import org.geotools.geometry.Envelope2D;
+import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.locationtech.jts.geom.*;
 import org.locationtech.jts.geom.impl.CoordinateArraySequence;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.awt.geom.Point2D;
 
@@ -118,7 +118,7 @@ public class GeometryFunctions {
     }
 
     public static Geometry envelope(GridCoverage2D raster) throws 
FactoryException {
-        Envelope2D envelope2D = raster.getEnvelope2D();
+        ReferencedEnvelope envelope2D = raster.getEnvelope2D();
 
         Envelope envelope = new Envelope(envelope2D.getMinX(), 
envelope2D.getMaxX(), envelope2D.getMinY(), envelope2D.getMaxY());
         int srid = RasterAccessors.srid(raster);
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/PixelFunctionEditors.java
 
b/common/src/main/java/org/apache/sedona/common/raster/PixelFunctionEditors.java
index 9e5f8456c..88afdb867 100644
--- 
a/common/src/main/java/org/apache/sedona/common/raster/PixelFunctionEditors.java
+++ 
b/common/src/main/java/org/apache/sedona/common/raster/PixelFunctionEditors.java
@@ -19,14 +19,13 @@
 package org.apache.sedona.common.raster;
 
 import org.apache.commons.lang3.tuple.Pair;
-import org.apache.sedona.common.Functions;
 import org.apache.sedona.common.utils.RasterUtils;
 import org.geotools.coverage.grid.GridCoverage2D;
-import org.geotools.geometry.DirectPosition2D;
+import org.geotools.geometry.Position2D;
 import org.locationtech.jts.geom.Coordinate;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import javax.media.jai.RasterFactory;
 import java.awt.*;
@@ -143,7 +142,7 @@ public class PixelFunctionEditors {
         if (geometryType.equalsIgnoreCase(Geometry.TYPENAME_POINT) || 
geometryType.equalsIgnoreCase(Geometry.TYPENAME_MULTIPOINT)) {
             Coordinate[] coordinates = geom.getCoordinates();
             for (Coordinate pointCoordinate: coordinates) {
-                int[] pointLocation = raster.getGridGeometry().worldToGrid(new 
DirectPosition2D(pointCoordinate.x, pointCoordinate.y)).getCoordinateValues();
+                int[] pointLocation = raster.getGridGeometry().worldToGrid(new 
Position2D(pointCoordinate.x, pointCoordinate.y)).getCoordinateValues();
                 double[] pixel = rasterCopied.getPixel(pointLocation[0], 
pointLocation[1], (double[]) null);
                 pixel[band - 1] = rasterizedGeomData.getPixel(0, 0, (double[]) 
null)[0];
                 rasterCopied.setPixel(pointLocation[0], pointLocation[1], 
pixel);
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/PixelFunctions.java 
b/common/src/main/java/org/apache/sedona/common/raster/PixelFunctions.java
index 65d0a040d..c6757b638 100644
--- a/common/src/main/java/org/apache/sedona/common/raster/PixelFunctions.java
+++ b/common/src/main/java/org/apache/sedona/common/raster/PixelFunctions.java
@@ -23,13 +23,12 @@ import org.apache.sedona.common.Functions;
 import org.apache.sedona.common.utils.RasterUtils;
 import org.geotools.coverage.grid.GridCoordinates2D;
 import org.geotools.coverage.grid.GridCoverage2D;
-import org.geotools.geometry.DirectPosition2D;
+import org.geotools.geometry.Position2D;
 import org.geotools.referencing.operation.transform.AffineTransform2D;
 import org.locationtech.jts.geom.*;
-import org.opengis.coverage.PointOutsideCoverageException;
-import org.opengis.geometry.DirectPosition;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.coverage.PointOutsideCoverageException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.awt.geom.Point2D;
 import java.awt.image.Raster;
@@ -277,7 +276,7 @@ public class PixelFunctions
                 result.add(null);
             } else {
                 Point point = ensurePoint(geom);
-                DirectPosition directPosition2D = new 
DirectPosition2D(point.getX(), point.getY());
+                Point2D.Double directPosition2D = new 
Point2D.Double(point.getX(), point.getY());
                 try {
                     rasterGeom.evaluate(directPosition2D, pixelBuffer);
                     double pixel = pixelBuffer[band - 1];
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/RasterAccessors.java 
b/common/src/main/java/org/apache/sedona/common/raster/RasterAccessors.java
index 4d04bd0a5..61a9cef0e 100644
--- a/common/src/main/java/org/apache/sedona/common/raster/RasterAccessors.java
+++ b/common/src/main/java/org/apache/sedona/common/raster/RasterAccessors.java
@@ -27,10 +27,10 @@ import org.locationtech.jts.geom.Coordinate;
 import org.locationtech.jts.geom.Geometry;
 import org.locationtech.jts.geom.GeometryFactory;
 import org.locationtech.jts.geom.Point;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.ReferenceIdentifier;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.ReferenceIdentifier;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.awt.geom.Point2D;
 import java.util.Arrays;
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/RasterBandAccessors.java 
b/common/src/main/java/org/apache/sedona/common/raster/RasterBandAccessors.java
index 7022a503c..62fa7f0cb 100644
--- 
a/common/src/main/java/org/apache/sedona/common/raster/RasterBandAccessors.java
+++ 
b/common/src/main/java/org/apache/sedona/common/raster/RasterBandAccessors.java
@@ -26,7 +26,7 @@ import org.apache.sedona.common.utils.RasterUtils;
 import org.geotools.coverage.GridSampleDimension;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.referencing.FactoryException;
+import org.geotools.api.referencing.FactoryException;
 
 import javax.media.jai.RasterFactory;
 import java.awt.image.Raster;
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/RasterBandEditors.java 
b/common/src/main/java/org/apache/sedona/common/raster/RasterBandEditors.java
index 68feb92d2..8d39ed370 100644
--- 
a/common/src/main/java/org/apache/sedona/common/raster/RasterBandEditors.java
+++ 
b/common/src/main/java/org/apache/sedona/common/raster/RasterBandEditors.java
@@ -25,9 +25,9 @@ import org.geotools.coverage.GridSampleDimension;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.coverage.processing.operation.Crop;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.parameter.ParameterValueGroup;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.parameter.ParameterValueGroup;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import javax.media.jai.RasterFactory;
 import java.awt.geom.Point2D;
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/RasterConstructors.java 
b/common/src/main/java/org/apache/sedona/common/raster/RasterConstructors.java
index c7635c70b..67b3ad812 100644
--- 
a/common/src/main/java/org/apache/sedona/common/raster/RasterConstructors.java
+++ 
b/common/src/main/java/org/apache/sedona/common/raster/RasterConstructors.java
@@ -27,7 +27,6 @@ import org.geotools.feature.simple.SimpleFeatureBuilder;
 import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
 import org.geotools.gce.arcgrid.ArcGridReader;
 import org.geotools.gce.geotiff.GeoTiffReader;
-import org.geotools.geometry.Envelope2D;
 import org.geotools.geometry.jts.JTS;
 import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.geotools.process.vector.VectorToRasterProcess;
@@ -36,13 +35,13 @@ import org.geotools.referencing.crs.DefaultEngineeringCRS;
 import org.geotools.referencing.operation.transform.AffineTransform2D;
 import org.geotools.util.factory.Hints;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.feature.simple.SimpleFeature;
-import org.opengis.feature.simple.SimpleFeatureType;
-import org.opengis.metadata.spatial.PixelOrientation;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.datum.PixelInCell;
-import org.opengis.referencing.operation.MathTransform;
+import org.geotools.api.feature.simple.SimpleFeature;
+import org.geotools.api.feature.simple.SimpleFeatureType;
+import org.geotools.api.metadata.spatial.PixelOrientation;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.datum.PixelInCell;
+import org.geotools.api.referencing.operation.MathTransform;
 import ucar.nc2.NetcdfFile;
 import ucar.nc2.NetcdfFiles;
 
@@ -176,26 +175,25 @@ public class RasterConstructors
             throw new IllegalArgumentException(String.format("SkewY %d of the 
raster is not zero.", metadata[7]));
         }
 
-        Envelope2D bound = null;
+        ReferencedEnvelope bound = null;
 
         if (useGeometryExtent) {
-            bound = JTS.getEnvelope2D(geom.getEnvelopeInternal(), 
raster.getCoordinateReferenceSystem2D());
+            bound = ReferencedEnvelope.envelope(geom.getEnvelopeInternal(), 
raster.getCoordinateReferenceSystem2D());
         } else {
-            ReferencedEnvelope envelope = 
ReferencedEnvelope.create(raster.getEnvelope(), 
raster.getCoordinateReferenceSystem());
-            bound = JTS.getEnvelope2D(envelope, 
raster.getCoordinateReferenceSystem2D());
+            bound = ReferencedEnvelope.create(raster.getEnvelope(), 
raster.getCoordinateReferenceSystem());
         }
 
         double scaleX = Math.abs(metadata[4]), scaleY = Math.abs(metadata[5]);
         int width = (int) bound.getWidth(), height = (int) bound.getHeight();
         if (width == 0 && height == 0) {
-            bound = new Envelope2D(bound.getCoordinateReferenceSystem(), 
bound.getCenterX() - scaleX * 0.5, bound.getCenterY() - scaleY * 0.5, scaleX, 
scaleY);
+            bound = ReferencedEnvelope.rect(bound.getCenterX() - scaleX * 0.5, 
bound.getCenterY() - scaleY * 0.5, scaleX, scaleY, 
bound.getCoordinateReferenceSystem());
             width = 1;
             height = 1;
         } else if (height == 0) {
-            bound = new Envelope2D(bound.getCoordinateReferenceSystem(), 
bound.getCenterX() - scaleX * 0.5, bound.getCenterY() - scaleY * 0.5, width, 
scaleY);
+            bound = ReferencedEnvelope.rect(bound.getCenterX() - scaleX * 0.5, 
bound.getCenterY() - scaleY * 0.5, width, scaleY, 
bound.getCoordinateReferenceSystem());
             height = 1;
         } else if (width == 0) {
-            bound = new Envelope2D(bound.getCoordinateReferenceSystem(), 
bound.getCenterX() - scaleX * 0.5, bound.getCenterY() - scaleY * 0.5, scaleX, 
height);
+            bound = ReferencedEnvelope.rect(bound.getCenterX() - scaleX * 0.5, 
bound.getCenterY() - scaleY * 0.5, scaleX, height, 
bound.getCoordinateReferenceSystem());
             width = 1;
         } else {
             // To preserve scale of reference raster
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/RasterConstructorsForTesting.java
 
b/common/src/main/java/org/apache/sedona/common/raster/RasterConstructorsForTesting.java
index 47667b9b8..6890ee6db 100644
--- 
a/common/src/main/java/org/apache/sedona/common/raster/RasterConstructorsForTesting.java
+++ 
b/common/src/main/java/org/apache/sedona/common/raster/RasterConstructorsForTesting.java
@@ -24,9 +24,9 @@ import org.geotools.coverage.grid.GridEnvelope2D;
 import org.geotools.coverage.grid.GridGeometry2D;
 import org.geotools.referencing.crs.DefaultEngineeringCRS;
 import org.geotools.referencing.operation.transform.AffineTransform2D;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.datum.PixelInCell;
-import org.opengis.referencing.operation.MathTransform;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.datum.PixelInCell;
+import org.geotools.api.referencing.operation.MathTransform;
 
 import javax.media.jai.RasterFactory;
 import java.awt.Transparency;
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/RasterEditors.java 
b/common/src/main/java/org/apache/sedona/common/raster/RasterEditors.java
index 235ae8cbd..fa9cefd9c 100644
--- a/common/src/main/java/org/apache/sedona/common/raster/RasterEditors.java
+++ b/common/src/main/java/org/apache/sedona/common/raster/RasterEditors.java
@@ -28,19 +28,19 @@ import org.geotools.coverage.grid.GridCoverageFactory;
 import org.geotools.coverage.grid.GridEnvelope2D;
 import org.geotools.coverage.grid.GridGeometry2D;
 import org.geotools.coverage.processing.Operations;
-import org.geotools.geometry.Envelope2D;
+import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.geotools.referencing.crs.DefaultEngineeringCRS;
 import org.geotools.referencing.operation.transform.AffineTransform2D;
 import org.locationtech.jts.index.strtree.STRtree;
-import org.opengis.coverage.grid.GridCoverage;
-import org.opengis.coverage.grid.GridGeometry;
-import org.opengis.metadata.spatial.PixelOrientation;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.datum.PixelInCell;
-import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.MathTransform2D;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.coverage.grid.GridCoverage;
+import org.geotools.api.coverage.grid.GridGeometry;
+import org.geotools.api.metadata.spatial.PixelOrientation;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.datum.PixelInCell;
+import org.geotools.api.referencing.operation.MathTransform;
+import org.geotools.api.referencing.operation.MathTransform2D;
+import org.geotools.api.referencing.operation.TransformException;
 
 import javax.media.jai.Interpolation;
 import javax.media.jai.RasterFactory;
@@ -178,7 +178,7 @@ public class RasterEditors
         }
 
 
-        Envelope2D envelope2D = raster.getEnvelope2D();
+        ReferencedEnvelope envelope2D = raster.getEnvelope2D();
         //process scale changes due to changes in widthOrScale and 
heightOrScale
         if (!useScale) {
             newScaleX = (Math.abs(envelope2D.getMaxX() - 
envelope2D.getMinX())) / newWidth;
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/RasterOutputs.java 
b/common/src/main/java/org/apache/sedona/common/raster/RasterOutputs.java
index ed585a015..42333d25c 100644
--- a/common/src/main/java/org/apache/sedona/common/raster/RasterOutputs.java
+++ b/common/src/main/java/org/apache/sedona/common/raster/RasterOutputs.java
@@ -25,9 +25,9 @@ import org.geotools.gce.arcgrid.ArcGridWriteParams;
 import org.geotools.gce.arcgrid.ArcGridWriter;
 import org.geotools.gce.geotiff.GeoTiffWriteParams;
 import org.geotools.gce.geotiff.GeoTiffWriter;
-import org.opengis.coverage.grid.GridCoverageWriter;
-import org.opengis.parameter.GeneralParameterValue;
-import org.opengis.parameter.ParameterValueGroup;
+import org.geotools.api.coverage.grid.GridCoverageWriter;
+import org.geotools.api.parameter.GeneralParameterValue;
+import org.geotools.api.parameter.ParameterValueGroup;
 
 import javax.imageio.ImageIO;
 import javax.imageio.ImageWriteParam;
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/RasterPredicates.java 
b/common/src/main/java/org/apache/sedona/common/raster/RasterPredicates.java
index c45db0bb1..e330475cf 100644
--- a/common/src/main/java/org/apache/sedona/common/raster/RasterPredicates.java
+++ b/common/src/main/java/org/apache/sedona/common/raster/RasterPredicates.java
@@ -30,12 +30,12 @@ import org.geotools.referencing.CRS;
 import org.geotools.referencing.crs.DefaultEngineeringCRS;
 import org.geotools.referencing.crs.DefaultGeographicCRS;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.ReferenceIdentifier;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.crs.GeographicCRS;
-import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.ReferenceIdentifier;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.crs.GeographicCRS;
+import org.geotools.api.referencing.operation.MathTransform;
+import org.geotools.api.referencing.operation.TransformException;
 
 public class RasterPredicates {
     /**
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/netcdf/NetCdfReader.java 
b/common/src/main/java/org/apache/sedona/common/raster/netcdf/NetCdfReader.java
index ad8f42370..032aa5193 100644
--- 
a/common/src/main/java/org/apache/sedona/common/raster/netcdf/NetCdfReader.java
+++ 
b/common/src/main/java/org/apache/sedona/common/raster/netcdf/NetCdfReader.java
@@ -21,8 +21,8 @@ package org.apache.sedona.common.raster.netcdf;
 import com.google.common.collect.ImmutableList;
 import org.apache.sedona.common.raster.RasterConstructors;
 import org.geotools.coverage.grid.GridCoverage2D;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.datum.PixelInCell;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.datum.PixelInCell;
 import ucar.ma2.Array;
 import ucar.nc2.*;
 
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/serde/CRSSerializer.java 
b/common/src/main/java/org/apache/sedona/common/raster/serde/CRSSerializer.java
index 9c427e34f..7e3c9fdfd 100644
--- 
a/common/src/main/java/org/apache/sedona/common/raster/serde/CRSSerializer.java
+++ 
b/common/src/main/java/org/apache/sedona/common/raster/serde/CRSSerializer.java
@@ -23,8 +23,8 @@ import com.github.benmanes.caffeine.cache.LoadingCache;
 import org.apache.commons.io.IOUtils;
 import org.geotools.referencing.CRS;
 import org.geotools.referencing.wkt.Formattable;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
 import si.uom.NonSI;
 import si.uom.SI;
 
diff --git 
a/common/src/main/java/org/apache/sedona/common/raster/serde/Serde.java 
b/common/src/main/java/org/apache/sedona/common/raster/serde/Serde.java
index 848c00b3f..e775ee46a 100644
--- a/common/src/main/java/org/apache/sedona/common/raster/serde/Serde.java
+++ b/common/src/main/java/org/apache/sedona/common/raster/serde/Serde.java
@@ -28,7 +28,7 @@ import org.geotools.coverage.grid.GridEnvelope2D;
 import org.geotools.coverage.grid.GridGeometry2D;
 import org.geotools.referencing.operation.transform.AffineTransform2D;
 import org.objenesis.strategy.StdInstantiatorStrategy;
-import org.opengis.referencing.operation.MathTransform;
+import org.geotools.api.referencing.operation.MathTransform;
 
 import javax.media.jai.RenderedImageAdapter;
 import java.awt.image.RenderedImage;
diff --git 
a/common/src/main/java/org/apache/sedona/common/utils/CachedCRSTransformFinder.java
 
b/common/src/main/java/org/apache/sedona/common/utils/CachedCRSTransformFinder.java
index 7d0cd1117..c3305733a 100644
--- 
a/common/src/main/java/org/apache/sedona/common/utils/CachedCRSTransformFinder.java
+++ 
b/common/src/main/java/org/apache/sedona/common/utils/CachedCRSTransformFinder.java
@@ -21,9 +21,9 @@ package org.apache.sedona.common.utils;
 import com.github.benmanes.caffeine.cache.Caffeine;
 import com.github.benmanes.caffeine.cache.LoadingCache;
 import org.geotools.referencing.CRS;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.MathTransform;
 
 /**
  * A utility class for finding CRS transforms. It avoids the expensive 
equals() call on CRS objects
diff --git 
a/common/src/main/java/org/apache/sedona/common/utils/RasterUtils.java 
b/common/src/main/java/org/apache/sedona/common/utils/RasterUtils.java
index e6e51495a..7cc6c5080 100644
--- a/common/src/main/java/org/apache/sedona/common/utils/RasterUtils.java
+++ b/common/src/main/java/org/apache/sedona/common/utils/RasterUtils.java
@@ -34,20 +34,19 @@ import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.coverage.grid.GridCoverageFactory;
 import org.geotools.coverage.grid.GridEnvelope2D;
 import org.geotools.coverage.grid.GridGeometry2D;
-import org.geotools.geometry.DirectPosition2D;
+import org.geotools.geometry.Position2D;
 import org.geotools.referencing.crs.DefaultEngineeringCRS;
 import org.geotools.referencing.operation.transform.AffineTransform2D;
 import org.geotools.util.ClassChanger;
 import org.geotools.util.NumberRange;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.coverage.grid.GridEnvelope;
-import org.opengis.geometry.DirectPosition;
-import org.opengis.metadata.spatial.PixelOrientation;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.TransformException;
-import org.opengis.util.InternationalString;
+import org.geotools.api.coverage.grid.GridEnvelope;
+import org.geotools.api.metadata.spatial.PixelOrientation;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.MathTransform;
+import org.geotools.api.referencing.operation.TransformException;
+import org.geotools.api.util.InternationalString;
 
 import javax.media.jai.RasterFactory;
 import javax.media.jai.RenderedImageAdapter;
@@ -418,9 +417,9 @@ public class RasterUtils {
         return 
raster.getGridGeometry().getGridToCRS2D(PixelOrientation.UPPER_LEFT).transform(gridCoordinates2D,
 null);
     }
     public static int[] getGridCoordinatesFromWorld(GridCoverage2D raster, 
double longitude, double latitude) throws TransformException {
-        DirectPosition2D directPosition2D = new 
DirectPosition2D(raster.getCoordinateReferenceSystem2D(), longitude, latitude);
-        DirectPosition worldCoord = 
raster.getGridGeometry().getCRSToGrid2D(PixelOrientation.UPPER_LEFT).transform((DirectPosition)
 directPosition2D, null);
-        double[] coords = worldCoord.getCoordinate();
+        Point2D directPosition2D = new 
Position2D(raster.getCoordinateReferenceSystem2D(), longitude, latitude);
+        Point2D worldCoord = 
raster.getGridGeometry().getCRSToGrid2D(PixelOrientation.UPPER_LEFT).transform(directPosition2D,
 null);
+        double[] coords = new double[] {worldCoord.getX(), worldCoord.getY()};
         int[] gridCoords = new int[] {(int) Math.floor(coords[0]), (int) 
Math.floor(coords[1])};
         return gridCoords;
     }
diff --git a/common/src/test/java/org/apache/sedona/common/FunctionsTest.java 
b/common/src/test/java/org/apache/sedona/common/FunctionsTest.java
index 701a24594..1512bb0b4 100644
--- a/common/src/test/java/org/apache/sedona/common/FunctionsTest.java
+++ b/common/src/test/java/org/apache/sedona/common/FunctionsTest.java
@@ -27,8 +27,8 @@ import org.locationtech.jts.geom.*;
 import org.locationtech.jts.io.ParseException;
 import org.locationtech.jts.io.WKTReader;
 import org.locationtech.jts.io.WKTWriter;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.util.*;
 import java.util.stream.Collectors;
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/FunctionEditorsTest.java 
b/common/src/test/java/org/apache/sedona/common/raster/FunctionEditorsTest.java
index b324e54eb..0e50749e5 100644
--- 
a/common/src/test/java/org/apache/sedona/common/raster/FunctionEditorsTest.java
+++ 
b/common/src/test/java/org/apache/sedona/common/raster/FunctionEditorsTest.java
@@ -26,8 +26,8 @@ import org.geotools.coverage.grid.GridCoverage2D;
 import org.junit.Test;
 import org.locationtech.jts.geom.Geometry;
 import org.locationtech.jts.io.ParseException;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.io.IOException;
 import java.util.Arrays;
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/FunctionsTest.java 
b/common/src/test/java/org/apache/sedona/common/raster/FunctionsTest.java
index 2bf3d491b..7327d614f 100644
--- a/common/src/test/java/org/apache/sedona/common/raster/FunctionsTest.java
+++ b/common/src/test/java/org/apache/sedona/common/raster/FunctionsTest.java
@@ -26,8 +26,8 @@ import org.locationtech.jts.geom.Geometry;
 import org.locationtech.jts.geom.GeometryFactory;
 import org.locationtech.jts.geom.Point;
 import org.locationtech.jts.io.ParseException;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.io.IOException;
 import java.util.ArrayList;
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/GeometryFunctionsTest.java
 
b/common/src/test/java/org/apache/sedona/common/raster/GeometryFunctionsTest.java
index a01fb5a88..703050c84 100644
--- 
a/common/src/test/java/org/apache/sedona/common/raster/GeometryFunctionsTest.java
+++ 
b/common/src/test/java/org/apache/sedona/common/raster/GeometryFunctionsTest.java
@@ -24,8 +24,8 @@ import org.junit.Test;
 import org.locationtech.jts.geom.Coordinate;
 import org.locationtech.jts.geom.Envelope;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.io.IOException;
 
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/MapAlgebraTest.java 
b/common/src/test/java/org/apache/sedona/common/raster/MapAlgebraTest.java
index 7bf17044c..79acf3af6 100644
--- a/common/src/test/java/org/apache/sedona/common/raster/MapAlgebraTest.java
+++ b/common/src/test/java/org/apache/sedona/common/raster/MapAlgebraTest.java
@@ -22,7 +22,7 @@ import org.apache.sedona.common.utils.RasterUtils;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opengis.referencing.FactoryException;
+import org.geotools.api.referencing.FactoryException;
 
 import java.awt.image.DataBuffer;
 import java.util.Random;
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/RasterAccessorsTest.java 
b/common/src/test/java/org/apache/sedona/common/raster/RasterAccessorsTest.java
index d8f52fca8..143d1d88a 100644
--- 
a/common/src/test/java/org/apache/sedona/common/raster/RasterAccessorsTest.java
+++ 
b/common/src/test/java/org/apache/sedona/common/raster/RasterAccessorsTest.java
@@ -26,8 +26,8 @@ import org.geotools.referencing.CRS;
 import org.geotools.referencing.operation.transform.AffineTransform2D;
 import org.junit.Test;
 import org.locationtech.jts.geom.*;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.io.IOException;
 
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/RasterBandAccessorsTest.java
 
b/common/src/test/java/org/apache/sedona/common/raster/RasterBandAccessorsTest.java
index 306aed86f..5514ac890 100644
--- 
a/common/src/test/java/org/apache/sedona/common/raster/RasterBandAccessorsTest.java
+++ 
b/common/src/test/java/org/apache/sedona/common/raster/RasterBandAccessorsTest.java
@@ -24,8 +24,8 @@ import org.geotools.coverage.grid.GridCoverage2D;
 import org.junit.Test;
 import org.locationtech.jts.geom.Geometry;
 import org.locationtech.jts.io.ParseException;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.io.IOException;
 import java.util.Arrays;
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/RasterBandEditorsTest.java
 
b/common/src/test/java/org/apache/sedona/common/raster/RasterBandEditorsTest.java
index 19b932ad7..0d8d147f3 100644
--- 
a/common/src/test/java/org/apache/sedona/common/raster/RasterBandEditorsTest.java
+++ 
b/common/src/test/java/org/apache/sedona/common/raster/RasterBandEditorsTest.java
@@ -24,8 +24,8 @@ import org.geotools.coverage.grid.GridCoverage2D;
 import org.junit.Test;
 import org.locationtech.jts.geom.Geometry;
 import org.locationtech.jts.io.ParseException;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.io.IOException;
 import java.text.DecimalFormat;
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/RasterConstructorsTest.java
 
b/common/src/test/java/org/apache/sedona/common/raster/RasterConstructorsTest.java
index 56427f567..80afd7860 100644
--- 
a/common/src/test/java/org/apache/sedona/common/raster/RasterConstructorsTest.java
+++ 
b/common/src/test/java/org/apache/sedona/common/raster/RasterConstructorsTest.java
@@ -16,16 +16,16 @@ package org.apache.sedona.common.raster;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.sedona.common.Constructors;
 import org.apache.sedona.common.utils.RasterUtils;
+import org.geotools.api.geometry.Position;
 import org.geotools.coverage.grid.GridCoordinates2D;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.junit.Assert;
 import org.junit.Test;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.coverage.SampleDimensionType;
-import org.opengis.geometry.DirectPosition;
+import org.geotools.api.coverage.SampleDimensionType;
 import org.locationtech.jts.io.ParseException;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.awt.image.DataBuffer;
 import java.awt.image.Raster;
@@ -415,8 +415,8 @@ public class RasterConstructorsTest
                     // Check that the pixel at the point translates to the 
same world coordinate as the corresponding
                     // pixel in the grid coverage
                     try {
-                        DirectPosition actualWorldCoord = 
tileRaster.getGridGeometry().gridToWorld(tileGridCoord);
-                        DirectPosition expectedWorldCoord = 
gridCoverage2D.getGridGeometry().gridToWorld(gridCoord);
+                        Position actualWorldCoord = 
tileRaster.getGridGeometry().gridToWorld(tileGridCoord);
+                        Position expectedWorldCoord = 
gridCoverage2D.getGridGeometry().gridToWorld(gridCoord);
                         Assert.assertEquals(expectedWorldCoord, 
actualWorldCoord);
                     } catch (TransformException e) {
                         throw new RuntimeException(e);
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/RasterEditorsTest.java 
b/common/src/test/java/org/apache/sedona/common/raster/RasterEditorsTest.java
index 0b811ba88..07af75b28 100644
--- 
a/common/src/test/java/org/apache/sedona/common/raster/RasterEditorsTest.java
+++ 
b/common/src/test/java/org/apache/sedona/common/raster/RasterEditorsTest.java
@@ -19,20 +19,20 @@
 package org.apache.sedona.common.raster;
 
 import org.apache.sedona.common.utils.RasterUtils;
+import org.geotools.api.geometry.Bounds;
+import org.geotools.api.geometry.Position;
 import org.geotools.coverage.grid.GridCoordinates2D;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.coverage.grid.GridEnvelope2D;
-import org.geotools.geometry.DirectPosition2D;
+import org.geotools.geometry.Position2D;
 import org.geotools.referencing.CRS;
 import org.geotools.referencing.operation.transform.AffineTransform2D;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opengis.geometry.DirectPosition;
-import org.opengis.geometry.Envelope;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.MathTransform;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.awt.image.DataBuffer;
 import java.io.IOException;
@@ -698,8 +698,8 @@ public class RasterEditorsTest extends RasterTestBase {
     private void verifyReprojectMatchResult(GridCoverage2D source, 
GridCoverage2D target, GridCoverage2D transformed)
             throws TransformException, FactoryException {
         // Check the envelope and CRS
-        Envelope expectedEnvelope = target.getEnvelope();
-        Envelope actualEnvelope = transformed.getEnvelope();
+        Bounds expectedEnvelope = target.getEnvelope();
+        Bounds actualEnvelope = transformed.getEnvelope();
         assertSameEnvelope(expectedEnvelope, actualEnvelope, 1e-6);
         CoordinateReferenceSystem expectedCrs = 
target.getCoordinateReferenceSystem();
         CoordinateReferenceSystem actualCrs = 
transformed.getCoordinateReferenceSystem();
@@ -726,11 +726,11 @@ public class RasterEditorsTest extends RasterTestBase {
         for (double worldY = ipY; worldY > expectedEnvelope.getMinimum(1); 
worldY += scaleY) {
             for (double worldX = ipX; worldX < expectedEnvelope.getMaximum(0); 
worldX += scaleX) {
                 // Fetch the pixel values from the transformed raster
-                DirectPosition worldPos = new DirectPosition2D(worldX, worldY);
+                Position worldPos = new Position2D(worldX, worldY);
                 transformed.evaluate(worldPos, values);
 
                 // Find the corresponding grid coordinates on the source raster
-                DirectPosition srcWorldPos = crsTrans.transform(worldPos, 
null);
+                Position srcWorldPos = crsTrans.transform(worldPos, null);
                 GridCoordinates2D sourceGridPos = 
source.getGridGeometry().worldToGrid(srcWorldPos);
                 GridEnvelope2D sourceGridRange = 
source.getGridGeometry().getGridRange2D();
 
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/RasterOutputTest.java 
b/common/src/test/java/org/apache/sedona/common/raster/RasterOutputTest.java
index dded35ca5..d75cd7576 100644
--- a/common/src/test/java/org/apache/sedona/common/raster/RasterOutputTest.java
+++ b/common/src/test/java/org/apache/sedona/common/raster/RasterOutputTest.java
@@ -21,7 +21,7 @@ package org.apache.sedona.common.raster;
 import org.apache.sedona.common.utils.RasterUtils;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.junit.Test;
-import org.opengis.referencing.FactoryException;
+import org.geotools.api.referencing.FactoryException;
 
 import javax.imageio.ImageIO;
 import java.io.File;
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/RasterPredicatesTest.java
 
b/common/src/test/java/org/apache/sedona/common/raster/RasterPredicatesTest.java
index 05d9605b9..c9c535985 100644
--- 
a/common/src/test/java/org/apache/sedona/common/raster/RasterPredicatesTest.java
+++ 
b/common/src/test/java/org/apache/sedona/common/raster/RasterPredicatesTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.sedona.common.raster;
 
+import org.geotools.api.geometry.BoundingBox;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.geometry.jts.JTS;
 import org.geotools.referencing.CRS;
@@ -30,10 +31,9 @@ import org.locationtech.jts.geom.Geometry;
 import org.locationtech.jts.geom.GeometryFactory;
 import org.locationtech.jts.geom.PrecisionModel;
 import org.locationtech.jts.io.ParseException;
-import org.opengis.geometry.BoundingBox;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.awt.image.DataBuffer;
 import java.io.IOException;
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/RasterTestBase.java 
b/common/src/test/java/org/apache/sedona/common/raster/RasterTestBase.java
index d531c77f6..b2b512f80 100644
--- a/common/src/test/java/org/apache/sedona/common/raster/RasterTestBase.java
+++ b/common/src/test/java/org/apache/sedona/common/raster/RasterTestBase.java
@@ -13,24 +13,25 @@
  */
 package org.apache.sedona.common.raster;
 
+ import org.geotools.api.geometry.Bounds;
+ import org.geotools.api.geometry.Position;
  import org.geotools.coverage.grid.GridCoordinates2D;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.coverage.grid.GridCoverageFactory;
 import org.geotools.gce.geotiff.GeoTiffReader;
 import org.geotools.gce.geotiff.GeoTiffWriter;
-import org.geotools.geometry.DirectPosition2D;
-import org.geotools.geometry.Envelope2D;
-import org.geotools.geometry.jts.ReferencedEnvelope;
+
+ import org.geotools.geometry.Position2D;
+ import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.geotools.referencing.CRS;
 import org.geotools.referencing.crs.DefaultGeographicCRS;
 import org.junit.Assert;
 import org.junit.Before;
-import org.opengis.geometry.DirectPosition;
-import org.opengis.geometry.Envelope;
-import org.opengis.parameter.GeneralParameterValue;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.TransformException;
+
+import org.geotools.api.parameter.GeneralParameterValue;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.TransformException;
 
 import javax.media.jai.RasterFactory;
 import java.awt.*;
@@ -118,7 +119,7 @@ public class RasterTestBase {
                 image.setRGB(i, j, new Color(color, color, color).getRGB());
             }
         }
-        return factory.create("test", image, new 
Envelope2D(DefaultGeographicCRS.WGS84, 0, 0, 10, 10));
+        return factory.create("test", image, ReferencedEnvelope.rect(0, 0, 10, 
10, DefaultGeographicCRS.WGS84));
     }
 
     protected void assertSameCoverage(GridCoverage2D expected, GridCoverage2D 
actual) {
@@ -127,8 +128,8 @@ public class RasterTestBase {
 
     protected void assertSameCoverage(GridCoverage2D expected, GridCoverage2D 
actual, int density) {
         Assert.assertEquals(expected.getNumSampleDimensions(), 
actual.getNumSampleDimensions());
-        Envelope expectedEnvelope = expected.getEnvelope();
-        Envelope actualEnvelope = actual.getEnvelope();
+        Bounds expectedEnvelope = expected.getEnvelope();
+        Bounds actualEnvelope = actual.getEnvelope();
         assertSameEnvelope(expectedEnvelope, actualEnvelope, 1e-6);
         CoordinateReferenceSystem expectedCrs = 
expected.getCoordinateReferenceSystem();
         CoordinateReferenceSystem actualCrs = 
actual.getCoordinateReferenceSystem();
@@ -136,7 +137,7 @@ public class RasterTestBase {
         assertSameValues(expected, actual, density);
     }
 
-    protected void assertSameEnvelope(Envelope expected, Envelope actual, 
double epsilon) {
+    protected void assertSameEnvelope(Bounds expected, Bounds actual, double 
epsilon) {
         Assert.assertEquals(expected.getMinimum(0), actual.getMinimum(0), 
epsilon);
         Assert.assertEquals(expected.getMinimum(1), actual.getMinimum(1), 
epsilon);
         Assert.assertEquals(expected.getMaximum(0), actual.getMaximum(0), 
epsilon);
@@ -144,7 +145,7 @@ public class RasterTestBase {
     }
 
     protected void assertSameValues(GridCoverage2D expected, GridCoverage2D 
actual, int density) {
-        Envelope expectedEnvelope = expected.getEnvelope();
+        Bounds expectedEnvelope = expected.getEnvelope();
         double x0 = expectedEnvelope.getMinimum(0);
         double y0 = expectedEnvelope.getMinimum(1);
         double xStep = (expectedEnvelope.getMaximum(0) - x0) / density;
@@ -156,7 +157,7 @@ public class RasterTestBase {
             for (int j = 0; j < density; j++) {
                 double x = x0 + j * xStep;
                 double y = y0 + i * yStep;
-                DirectPosition position = new DirectPosition2D(x, y);
+                Position position = new Position2D(x, y);
                 try {
                     GridCoordinates2D gridPosition = 
expected.getGridGeometry().worldToGrid(position);
                     if (Double.isNaN(gridPosition.getX()) || 
Double.isNaN(gridPosition.getY())) {
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/serde/CRSSerializerTest.java
 
b/common/src/test/java/org/apache/sedona/common/raster/serde/CRSSerializerTest.java
index bb5399fd0..8603deea1 100644
--- 
a/common/src/test/java/org/apache/sedona/common/raster/serde/CRSSerializerTest.java
+++ 
b/common/src/test/java/org/apache/sedona/common/raster/serde/CRSSerializerTest.java
@@ -21,8 +21,8 @@ package org.apache.sedona.common.raster.serde;
 import org.geotools.referencing.CRS;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
 
 public class CRSSerializerTest {
     @Test
diff --git 
a/common/src/test/java/org/apache/sedona/common/raster/serde/SerdeTest.java 
b/common/src/test/java/org/apache/sedona/common/raster/serde/SerdeTest.java
index 844c3d34f..3535775b7 100644
--- a/common/src/test/java/org/apache/sedona/common/raster/serde/SerdeTest.java
+++ b/common/src/test/java/org/apache/sedona/common/raster/serde/SerdeTest.java
@@ -23,7 +23,7 @@ import org.apache.sedona.common.raster.RasterTestBase;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.gce.geotiff.GeoTiffReader;
 import org.junit.Test;
-import org.opengis.referencing.FactoryException;
+import org.geotools.api.referencing.FactoryException;
 
 import java.io.File;
 import java.io.IOException;
diff --git a/docs/api/java-api.md b/docs/api/java-api.md
index f8400091d..e31fdb607 100644
--- a/docs/api/java-api.md
+++ b/docs/api/java-api.md
@@ -1,3 +1,3 @@
-Please read [Javadoc](../javadoc/spark/)
+Please read [Scaladoc](../scaladoc/spark/)
 
 Note: Scala can call Java APIs seamlessly. That means Scala users use the same 
APIs with Java users
diff --git a/docs/api/python-api.md b/docs/api/python-api.md
deleted file mode 100644
index 4737ccfdf..000000000
--- a/docs/api/python-api.md
+++ /dev/null
@@ -1 +0,0 @@
-Will be available soon.
diff --git a/docs/api/viz/java-api.md b/docs/api/viz/java-api.md
index 217a8f250..e31fdb607 100644
--- a/docs/api/viz/java-api.md
+++ b/docs/api/viz/java-api.md
@@ -1,3 +1,3 @@
-Please read [Javadoc](../../javadoc/spark/)
+Please read [Scaladoc](../scaladoc/spark/)
 
 Note: Scala can call Java APIs seamlessly. That means Scala users use the same 
APIs with Java users
diff --git a/docs/community/develop.md b/docs/community/develop.md
index 6d48f4b13..e5007fdc5 100644
--- a/docs/community/develop.md
+++ b/docs/community/develop.md
@@ -4,7 +4,7 @@
 
 ### IDE
 
-We recommend [Intellij IDEA](https://www.jetbrains.com/idea/) with Scala 
plugin installed. Please make sure that the IDE has JDK 1.8 set as project 
default.
+We recommend [Intellij IDEA](https://www.jetbrains.com/idea/) with Scala 
plugin installed. Please make sure that the IDE has JDK 1.11 set as project 
default.
 
 ### Import the project
 
diff --git a/docs/community/release-manager.md 
b/docs/community/release-manager.md
index 1702f2167..88044b21c 100644
--- a/docs/community/release-manager.md
+++ b/docs/community/release-manager.md
@@ -4,13 +4,13 @@ You only need to perform these steps if this is your first 
time being a release
 
 ## 0. Software requirement
 
-* JDK 8: `brew install openjdk@8`
-* Maven 3.X. Your Maven must point to JDK 8 (1.8). Check it by `mvn --version`
+* JDK 11: `brew install openjdk@11`
+* Maven 3.X. Your Maven must point to JDK 11 (1.11). Check it by `mvn 
--version`
 * Git and SVN
 
-If your Maven (`mvn --version`) points to other JDK versions, you must change 
it to JDK 8. Steps are as follows:
+If your Maven (`mvn --version`) points to other JDK versions, you must change 
it to JDK 11. Steps are as follows:
 
-1. Find all Java installed on your machine: `/usr/libexec/java_home -V`. You 
should see multiple JDK versions including JDK 8.
+1. Find all Java installed on your machine: `/usr/libexec/java_home -V`. You 
should see multiple JDK versions including JDK 11.
 2. Run `whereis mvn` to get the installation location of your Maven. The 
result is a symlink to the actual location.
 3. Open it in the terminal (with `sudo` if needed). It will be like this
 
@@ -19,14 +19,14 @@ If your Maven (`mvn --version`) points to other JDK 
versions, you must change it
 JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home)}" exec 
"/usr/local/Cellar/maven/3.6.3/libexec/bin/mvn" "$@"
 ```
 
-4. Change `JAVA_HOME:-$(/usr/libexec/java_home)}` to 
`JAVA_HOME:-$(/usr/libexec/java_home -v 1.8)}`.  The resulting content will be 
like this:
+4. Change `JAVA_HOME:-$(/usr/libexec/java_home)}` to 
`JAVA_HOME:-$(/usr/libexec/java_home -v 1.11)}`.  The resulting content will be 
like this:
 
 ```
 #!/bin/bash
-JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home -v 1.8)}" exec 
"/usr/local/Cellar/maven/3.6.3/libexec/bin/mvn" "$@"
+JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home -v 1.11)}" exec 
"/usr/local/Cellar/maven/3.6.3/libexec/bin/mvn" "$@"
 ```
 
-5. Run `mvn --version` again. It should now point to JDK 8.
+5. Run `mvn --version` again. It should now point to JDK 11.
 
 ## 1. Obtain Write Access to Sedona GitHub repo
 
diff --git a/docs/community/vote.md b/docs/community/vote.md
index f59eceace..ca1445021 100644
--- a/docs/community/vote.md
+++ b/docs/community/vote.md
@@ -17,7 +17,7 @@ If you prefer to run the steps on your local machine, please 
read the steps belo
 ## Install necessary software
 
 1. GPG: On Mac `brew install gnupg gnupg2`. You can check in a terminal `gpg 
--version`.
-2. JDK 1.8 or 1.11. Your Mac might have many different Java versions 
installed. You can try to use it but not sure if it can pass. You can check in 
a terminal `java --version`.
+2. JDK 1.11. Your Mac might have many different Java versions installed. You 
can try to use it but not sure if it can pass. You can check in a terminal 
`java --version`.
 3. Apache Maven 3.3.1+. On Mac `brew install maven`. You can check it in a 
terminal `mvn -version`.
 4. Python3 installed on your machine. MacOS comes with Python3 by default. You 
can check in a terminal `python3 --version`.
 
diff --git a/docs/setup/cluster.md b/docs/setup/cluster.md
index 2f07f6040..30d19629b 100644
--- a/docs/setup/cluster.md
+++ b/docs/setup/cluster.md
@@ -5,7 +5,7 @@ Download a Spark distribution from [Spark download 
page](http://spark.apache.org
 ## Preliminary
 
 1. Set up a password-less SSH on your cluster. Each master-worker pair should 
have bidirectional password-less SSH.
-2. Make sure you have installed JRE 1.8 or later.
+2. Make sure you have installed JRE 1.11 or later.
 3. Add the list of your workers' IP address in ./conf/slaves
 4. Besides the necessary Spark settings, you may need to add the following 
lines in the Spark configuration files to avoid Sedona memory errors:
 
diff --git a/docs/setup/compile.md b/docs/setup/compile.md
index 7d2fd8d96..12ffe4a6a 100644
--- a/docs/setup/compile.md
+++ b/docs/setup/compile.md
@@ -6,7 +6,7 @@
 
 Sedona Scala/Java code is a project with multiple modules. Each module is a 
Scala/Java mixed project which is managed by Apache Maven 3.
 
-* Make sure your Linux/Mac machine has Java 1.8, Apache Maven 3.3.1+, and 
Python3.7+. The compilation of Sedona is not tested on Windows machines.
+* Make sure your Linux/Mac machine has Java 1.11, Apache Maven 3.3.1+, and 
Python3.7+. The compilation of Sedona is not tested on Windows machines.
 
 To compile all modules, please make sure you are in the root folder of all 
modules. Then enter the following command in the terminal:
 
diff --git a/docs/setup/flink/platform.md b/docs/setup/flink/platform.md
index 10865c9e8..7876092a0 100644
--- a/docs/setup/flink/platform.md
+++ b/docs/setup/flink/platform.md
@@ -1,4 +1,4 @@
-Sedona Flink binary releases are compiled by Java 1.8 and Scala 2.12, and 
tested in the following environments:
+Sedona Flink binary releases are compiled by Java 1.11 and Scala 2.12, and 
tested in the following environments:
 
 === "Sedona Scala/Java"
 
diff --git a/docs/setup/platform.md b/docs/setup/platform.md
index 400668eb0..4a1d62845 100644
--- a/docs/setup/platform.md
+++ b/docs/setup/platform.md
@@ -1,4 +1,4 @@
-Sedona binary releases are compiled by Java 1.8 and Scala 2.11/2.12 and tested 
in the following environments:
+Sedona binary releases are compiled by Java 1.11 and Scala 2.12/2.13 and 
tested in the following environments:
 
 !!!warning
        Support of Spark 2.X and Scala 2.11 was removed in Sedona 1.3.0+ 
although some parts of the source code might still be compatible. Sedona 1.3.0+ 
release binary for both Scala 2.12 and 2.13.
diff --git a/docs/tutorial/demo.md b/docs/tutorial/demo.md
index a21443184..14899c12e 100644
--- a/docs/tutorial/demo.md
+++ b/docs/tutorial/demo.md
@@ -18,7 +18,7 @@ The folder structure of this repository is as follows.
 Please make sure you have the following software installed on your local 
machine:
 
 * For Scala: Scala 2.12
-* For Java: JDK 1.8, Apache Maven 3
+* For Java: JDK 1.11, Apache Maven 3
 
 ### Compile
 
diff --git 
a/flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java 
b/flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java
index 013fb7241..fe34c38ea 100644
--- a/flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java
+++ b/flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java
@@ -13,7 +13,6 @@
  */
 package org.apache.sedona.flink.expressions;
 
-import org.apache.calcite.runtime.Geometries;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.flink.table.annotation.DataTypeHint;
 import org.apache.flink.table.annotation.InputGroup;
@@ -21,8 +20,6 @@ import org.apache.flink.table.functions.ScalarFunction;
 import org.apache.sedona.common.FunctionsGeoTools;
 import org.locationtech.jts.geom.Geometry;
 import org.locationtech.jts.operation.buffer.BufferParameters;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
 
 import java.util.Arrays;
 
@@ -72,21 +69,21 @@ public class Functions {
     public static class ST_Buffer extends ScalarFunction {
         @DataTypeHint(value = "RAW", bridgedTo = 
org.locationtech.jts.geom.Geometry.class)
         public Geometry eval(@DataTypeHint(value = "RAW", bridgedTo = 
org.locationtech.jts.geom.Geometry.class)
-        Object o, @DataTypeHint("Double") Double radius) throws 
FactoryException, TransformException {
+        Object o, @DataTypeHint("Double") Double radius) {
             Geometry geom = (Geometry) o;
             return org.apache.sedona.common.Functions.buffer(geom, radius);
         }
 
         @DataTypeHint(value = "RAW", bridgedTo = 
org.locationtech.jts.geom.Geometry.class)
         public Geometry eval(@DataTypeHint(value = "RAW", bridgedTo = 
org.locationtech.jts.geom.Geometry.class)
-                             Object o, @DataTypeHint("Double") Double radius, 
@DataTypeHint("Boolean") Boolean useSpheroid) throws FactoryException, 
TransformException {
+                             Object o, @DataTypeHint("Double") Double radius, 
@DataTypeHint("Boolean") Boolean useSpheroid) {
             Geometry geom = (Geometry) o;
             return org.apache.sedona.common.Functions.buffer(geom, radius, 
useSpheroid);
         }
 
         @DataTypeHint(value = "RAW", bridgedTo = 
org.locationtech.jts.geom.Geometry.class)
         public Geometry eval(@DataTypeHint(value = "RAW", bridgedTo = 
org.locationtech.jts.geom.Geometry.class)
-                             Object o, @DataTypeHint("Double") Double radius, 
@DataTypeHint("Boolean") Boolean useSpheroid, @DataTypeHint("String") String 
params) throws FactoryException, TransformException {
+                             Object o, @DataTypeHint("Double") Double radius, 
@DataTypeHint("Boolean") Boolean useSpheroid, @DataTypeHint("String") String 
params) {
             Geometry geom = (Geometry) o;
             return org.apache.sedona.common.Functions.buffer(geom, radius, 
useSpheroid, params);
         }
diff --git 
a/flink/src/main/java/org/apache/sedona/flink/expressions/FunctionsGeoTools.java
 
b/flink/src/main/java/org/apache/sedona/flink/expressions/FunctionsGeoTools.java
index 65054cf11..842ef42eb 100644
--- 
a/flink/src/main/java/org/apache/sedona/flink/expressions/FunctionsGeoTools.java
+++ 
b/flink/src/main/java/org/apache/sedona/flink/expressions/FunctionsGeoTools.java
@@ -15,8 +15,8 @@ package org.apache.sedona.flink.expressions;
 import org.apache.flink.table.annotation.DataTypeHint;
 import org.apache.flink.table.functions.ScalarFunction;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 
 public class FunctionsGeoTools {
diff --git a/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java 
b/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java
index 0306e5b52..daef6d9b1 100644
--- a/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java
+++ b/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java
@@ -27,8 +27,8 @@ import org.junit.Test;
 import org.locationtech.jts.geom.*;
 import org.locationtech.jts.io.ParseException;
 import org.locationtech.jts.operation.buffer.BufferParameters;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
 import scala.collection.immutable.Stream;
 
 import java.util.Arrays;
diff --git a/mkdocs.yml b/mkdocs.yml
index 92b8a3af8..ec3bdc946 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -80,7 +80,7 @@ nav:
               - Raster affine transformation: 
api/sql/Raster-affine-transformation.md
           - Parameter: api/sql/Parameter.md
         - RDD (core):
-          - Scala/Java doc: api/java-api.md
+          - Scala doc: api/java-api.md
         - Viz:
           - DataFrame/SQL: api/viz/sql.md
           - RDD: api/viz/java-api.md
diff --git a/pom.xml b/pom.xml
index d4f4265c0..6ecc8eefe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -68,7 +68,7 @@
         <maven.compiler.plugin.version>3.10.1</maven.compiler.plugin.version>
 
         <cdm.version>5.4.2</cdm.version>
-        <geotools.version>28.2</geotools.version>
+        <geotools.version>31.0</geotools.version>
         <hadoop.version>3.2.4</hadoop.version>
         <jackson.version>2.13.4</jackson.version>
         <jts.version>1.19.0</jts.version>
diff --git a/python/tests/sql/test_dataframe_api.py 
b/python/tests/sql/test_dataframe_api.py
index 56ec8212a..1c558d2f1 100644
--- a/python/tests/sql/test_dataframe_api.py
+++ b/python/tests/sql/test_dataframe_api.py
@@ -87,7 +87,7 @@ test_configurations = [
     (stf.ST_BestSRID, ("geom",), "triangle_geom", "", 3395),
     (stf.ST_Boundary, ("geom",), "triangle_geom", "", "LINESTRING (0 0, 1 0, 1 
1, 0 0)"),
     (stf.ST_Buffer, ("point", 1.0), "point_geom", "ST_ReducePrecision(geom, 
2)", "POLYGON ((0.98 0.8, 0.92 0.62, 0.83 0.44, 0.71 0.29, 0.56 0.17, 0.38 
0.08, 0.2 0.02, 0 0, -0.2 0.02, -0.38 0.08, -0.56 0.17, -0.71 0.29, -0.83 0.44, 
-0.92 0.62, -0.98 0.8, -1 1, -0.98 1.2, -0.92 1.38, -0.83 1.56, -0.71 1.71, 
-0.56 1.83, -0.38 1.92, -0.2 1.98, 0 2, 0.2 1.98, 0.38 1.92, 0.56 1.83, 0.71 
1.71, 0.83 1.56, 0.92 1.38, 0.98 1.2, 1 1, 0.98 0.8))"),
-    (stf.ST_Buffer, ("point", 1.0, True), "point_geom", "", "POLYGON 
((0.0000089758113634 1.0000000082631704, 0.0000088049473096 0.9999982455016537, 
0.0000082957180969 0.9999965501645043, 0.0000074676931201 0.9999949874025787, 
0.0000063526929175 0.9999936172719434, 0.0000049935663218 0.9999924924259491, 
0.000003442543808 0.9999916560917964, 0.0000017592303026 0.9999911404093366, 
0.0000000083146005 0.999990965195956, -0.0000017429165916 0.9999911371850047, 
-0.0000034271644398 0.9999916497 [...]
+    (stf.ST_Buffer, ("point", 1.0, True), "point_geom", "ST_Area(geom)", 
2.531298835379864e-10),
     (stf.ST_BuildArea, ("geom",), "multiline_geom", "ST_Normalize(geom)", 
"POLYGON ((0 0, 1 1, 1 0, 0 0))"),
     (stf.ST_BoundingDiagonal, ("geom",), "square_geom", 
"ST_BoundingDiagonal(geom)", "LINESTRING (1 0, 2 1)"),
     (stf.ST_Centroid, ("geom",), "triangle_geom", "ST_ReducePrecision(geom, 
2)", "POINT (0.67 0.33)"),
diff --git 
a/snowflake/src/main/java/org/apache/sedona/snowflake/snowsql/GeoToolsWrapper.java
 
b/snowflake/src/main/java/org/apache/sedona/snowflake/snowsql/GeoToolsWrapper.java
index ef96ab05a..9f53fce7b 100644
--- 
a/snowflake/src/main/java/org/apache/sedona/snowflake/snowsql/GeoToolsWrapper.java
+++ 
b/snowflake/src/main/java/org/apache/sedona/snowflake/snowsql/GeoToolsWrapper.java
@@ -15,8 +15,8 @@ package org.apache.sedona.snowflake.snowsql;
 
 import org.apache.sedona.common.FunctionsGeoTools;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 public class GeoToolsWrapper {
     public static Geometry transform(Geometry geometry, String sourceCRS, 
String targetCRS, boolean lenient) {
diff --git 
a/spark/common/src/main/java/org/apache/sedona/core/spatialOperator/KNNQuery.java
 
b/spark/common/src/main/java/org/apache/sedona/core/spatialOperator/KNNQuery.java
index 71bf27756..775c477b0 100644
--- 
a/spark/common/src/main/java/org/apache/sedona/core/spatialOperator/KNNQuery.java
+++ 
b/spark/common/src/main/java/org/apache/sedona/core/spatialOperator/KNNQuery.java
@@ -26,8 +26,8 @@ import 
org.apache.sedona.core.knnJudgement.KnnJudgementUsingIndex;
 import org.apache.sedona.core.spatialRDD.SpatialRDD;
 import org.apache.spark.api.java.JavaRDD;
 import org.locationtech.jts.geom.Geometry;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 
 import java.io.Serializable;
 import java.util.List;
diff --git 
a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinedGeometryRaster.scala
 
b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinedGeometryRaster.scala
index a3fd7d3c4..03d6fd617 100644
--- 
a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinedGeometryRaster.scala
+++ 
b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinedGeometryRaster.scala
@@ -20,14 +20,13 @@ package org.apache.spark.sql.sedona_sql.strategy.join
 
 import org.apache.sedona.common.FunctionsGeoTools
 import org.apache.sedona.common.utils.{CachedCRSTransformFinder, GeomUtils}
+import org.geotools.api.geometry.{BoundingBox, Bounds}
 import org.geotools.coverage.grid.GridCoverage2D
-import org.geotools.geometry.Envelope2D
-import org.geotools.geometry.jts.JTS
+import org.geotools.geometry.jts.{JTS, ReferencedEnvelope}
 import org.geotools.referencing.CRS
 import org.geotools.referencing.crs.{DefaultEngineeringCRS, 
DefaultGeographicCRS}
 import org.locationtech.jts.geom.{Envelope, Geometry}
-import org.opengis.geometry.BoundingBox
-import org.opengis.referencing.crs.{CoordinateReferenceSystem, GeographicCRS}
+import org.geotools.api.referencing.crs.{CoordinateReferenceSystem, 
GeographicCRS}
 
 object JoinedGeometryRaster {
   /**
@@ -58,13 +57,13 @@ object JoinedGeometryRaster {
       geom
     } else {
       val env = geom.getEnvelopeInternal
-      val envelope = new Envelope2D(null, env.getMinX, env.getMinY, 
env.getWidth, env.getHeight)
+      val envelope = ReferencedEnvelope.rect(env.getMinX, env.getMinY, 
env.getWidth, env.getHeight, null)
       val crs = FunctionsGeoTools.sridToCRS(srid)
       transformToWGS84Envelope(envelope, crs)
     }
   }
 
-  private def transformToWGS84Envelope(envelope: 
org.opengis.geometry.Envelope, crs: CoordinateReferenceSystem): Geometry = {
+  private def transformToWGS84Envelope(envelope: Bounds, crs: 
CoordinateReferenceSystem): Geometry = {
     // We use CRS.transform for envelopes to transform envelopes between 
different CRSs. This transformation function
     // could handle envelope crossing the anti-meridian and envelope near or 
covering poles correctly. We won't have
     // these cases properly handled if we transform the original geometries 
using JTS.transform.
diff --git 
a/spark/common/src/test/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/ShapefileRDDTest.java
 
b/spark/common/src/test/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/ShapefileRDDTest.java
index 2c2d4b7ca..52a626707 100644
--- 
a/spark/common/src/test/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/ShapefileRDDTest.java
+++ 
b/spark/common/src/test/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/ShapefileRDDTest.java
@@ -29,9 +29,9 @@ import org.apache.sedona.core.spatialRDD.PointRDD;
 import org.apache.sedona.core.spatialRDD.PolygonRDD;
 import org.apache.spark.SparkConf;
 import org.apache.spark.api.java.JavaSparkContext;
-import org.geotools.data.DataStore;
-import org.geotools.data.DataStoreFinder;
-import org.geotools.data.FeatureSource;
+import org.geotools.api.data.DataStore;
+import org.geotools.api.data.DataStoreFinder;
+import org.geotools.api.data.FeatureSource;
 import org.geotools.data.shapefile.files.ShpFiles;
 import org.geotools.data.shapefile.shp.ShapefileReader;
 import org.geotools.feature.FeatureCollection;
@@ -44,9 +44,9 @@ import org.locationtech.jts.geom.Envelope;
 import org.locationtech.jts.geom.Geometry;
 import org.locationtech.jts.geom.GeometryFactory;
 import org.locationtech.jts.geom.MultiPolygon;
-import org.opengis.feature.simple.SimpleFeature;
-import org.opengis.feature.simple.SimpleFeatureType;
-import org.opengis.filter.Filter;
+import org.geotools.api.feature.simple.SimpleFeature;
+import org.geotools.api.feature.simple.SimpleFeatureType;
+import org.geotools.api.filter.Filter;
 
 import java.io.File;
 import java.io.IOException;
diff --git 
a/spark/common/src/test/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/ShapefileReaderTest.java
 
b/spark/common/src/test/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/ShapefileReaderTest.java
index 65d145ed5..545545a03 100644
--- 
a/spark/common/src/test/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/ShapefileReaderTest.java
+++ 
b/spark/common/src/test/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/ShapefileReaderTest.java
@@ -37,9 +37,9 @@ import org.apache.sedona.core.spatialRDD.PointRDD;
 import org.apache.sedona.core.spatialRDD.PolygonRDD;
 import org.apache.sedona.core.spatialRDD.SpatialRDD;
 import org.apache.spark.SparkException;
-import org.geotools.data.DataStore;
-import org.geotools.data.DataStoreFinder;
-import org.geotools.data.FeatureSource;
+import org.geotools.api.data.DataStore;
+import org.geotools.api.data.DataStoreFinder;
+import org.geotools.api.data.FeatureSource;
 import org.geotools.data.shapefile.files.ShpFiles;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.feature.FeatureIterator;
@@ -50,10 +50,10 @@ import org.locationtech.jts.geom.Envelope;
 import org.locationtech.jts.geom.Geometry;
 import org.locationtech.jts.geom.GeometryFactory;
 import org.locationtech.jts.geom.MultiPolygon;
-import org.opengis.feature.Property;
-import org.opengis.feature.simple.SimpleFeature;
-import org.opengis.feature.simple.SimpleFeatureType;
-import org.opengis.filter.Filter;
+import org.geotools.api.feature.Property;
+import org.geotools.api.feature.simple.SimpleFeature;
+import org.geotools.api.feature.simple.SimpleFeatureType;
+import org.geotools.api.filter.Filter;
 
 import java.io.File;
 import java.io.IOException;
diff --git 
a/spark/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala 
b/spark/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala
index 3fee1e53c..f880b0700 100644
--- a/spark/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala
+++ b/spark/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala
@@ -32,7 +32,7 @@ import org.locationtech.jts.geom.{Coordinate, Geometry, 
GeometryFactory, Polygon
 import org.locationtech.jts.io.WKTWriter
 import org.locationtech.jts.linearref.LengthIndexedLine
 import org.locationtech.jts.operation.distance3d.Distance3DOp
-import org.opengis.referencing.FactoryException
+import org.geotools.api.referencing.FactoryException
 import org.scalatest.{GivenWhenThen, Matchers}
 import org.xml.sax.InputSource
 

Reply via email to