Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue using RS_FromGeoTiff (1.5.0) #1064

Closed
JHEBentley opened this issue Oct 30, 2023 · 2 comments
Closed

Issue using RS_FromGeoTiff (1.5.0) #1064

JHEBentley opened this issue Oct 30, 2023 · 2 comments

Comments

@JHEBentley
Copy link

Expected behavior

I am reading in sample raster data provided for the rasters demo notebooks using the method outlined in the docs. I expected to extract raster geometry.

Actual behavior

Getting error java.lang.NoClassDefFoundError: org/geotools/coverage/grid/GridCoverage2D when executing RS_FromGeoTiff(content). I originally thought this could be related to my original raster data using a custom crs, however this error is the outcome regardless of the source data (either my own data or the demo data provided in the Sedona examples).

Steps to reproduce the problem

%python
rawDf = sedona.read.format("binaryFile").load("<path>/T21HUB_4704_4736_8224_8256.tif")
rawDf.createOrReplaceTempView("rawdf")
rawDf.show()

\\SUCCESS
%sql
SELECT RS_FromGeoTiff(content) AS rast, modificationTime, length, path FROM rawdf

java.lang.NoClassDefFoundError: org/geotools/coverage/grid/GridCoverage2D

Py4JJavaError: An error occurred while calling o348.sql.
: java.lang.NoClassDefFoundError: org/geotools/coverage/grid/GridCoverage2D

Likewise when running:

df = sedona.read.format("binaryFile").load("/some/path/T21HUB_4704_4736_8224_8256.tif")
df = df.withColumn("raster", f.expr("RS_FromGeoTiff(content)"))

java.lang.NoClassDefFoundError: org/geotools/coverage/grid/GridCoverage2D

Py4JJavaError: An error occurred while calling o1016.withColumn.
: java.lang.NoClassDefFoundError: org/geotools/coverage/grid/GridCoverage2D

Settings

Sedona version = 1.5.0

Apache Spark version = 3.3.2

API type = Python

Scala version = 2.12

Environment = Databricks

@jiayuasu
Copy link
Member

@JHEBentley have you added the geotools-wrapper 1.5.0-25.2 dependency to your Python setup? Please see here: https://sedona.apache.org/1.5.0/setup/install-python/

@JHEBentley
Copy link
Author

Apologies, I still had the 1.4.1 dependency lingering on the cluster, my bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants