Hey everyone, I'm hitting a roadblock when trying to reproject coordinates to a Polyconic projection (specifically EPSG:5880 / Brazil Polyconic).
I'm starting from EPSG:4674 and trying to transform to EPSG:5880. I've tried using the standard EPSG code, Proj4 strings, and OGC WKT definitions, but Sedona always fails with an InferredExpressionException.
cause: Unknown projection: poly (or Unknown projection: Polyconic when using WKT/EPSG)
It seems the underlying GeoTools library isn't recognizing the American Polyconic projection math. Am I missing a specific config/dependency, or is this projection currently unsupported by Sedona's ST_Transform?
sedona.sql("SELECT ST_Transform(geometry, 'EPSG:4674', 'EPSG:5880', true) as geom_5880 from bronze_deter_cerrado").show()
26/06/29 13:45:22 ERROR Executor: Exception in task 0.0 in stage 13.0 (TID 22)1]
org.apache.spark.sql.sedona_sql.expressions.InferredExpressionException: Exception occurred while evaluating expression ST_Transform - inputs: [MULTIPOLYGON (((-55.7735 -12.7529, -55.7735 -12.753, -55.7744 -12.753, -55.7976 -12.758, -55.7985 -12.758, -55.7985 -12.7578, -55.7994 -12.7578, -55.8022 -12.7585, -55.8027 -12.7602, -55.8024 -12.7602, -55.8028 -12.7611, -55.8028 -12.7613, -55.7981 -12.7601, -55.7981 -12.7601, -55.7962 -12.7601, -55.7962 -12.7598, -55.7956 -12.7598, -55.7956 -12.7595, -55.794 -12.7595, -55.794 -12.7593, -55.7919 -12.7593, -55.7919 -12.759, -55.7908 -12.759, -55.7908 -12.7587, -55.7886 -12.7587, -55.7886 -12.7585, -55.7875 -12.7585, -55.7875 -12.7582, -55.7859 -12.7582, -55.7859 -12.7579, -55.7851 -12.7579, -55.7851 -12.7577, -55.7844 -12.7577, -55.7842 -12.7572, -55.7794 -12.757, -55.7792 -12.757, -55.7745 -12.7554, -55.7726 -12.7552, -55.7735 -12.7529))), EPSG:4674, EPSG:5880, true], cause: Unknown projection: American Polyconic
at org.apache.spark.sql.sedona_sql.expressions.InferredExpression$.throwExpressionInferenceException(InferredExpression.scala:149)
sedona.sql("""select ST_Transform(geometry, 'EPSG:4674', '+proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs') as geom_5880 from bronze_deter_cerrado""").show(1)
26/06/29 14:04:04 ERROR Executor: Exception in task 0.0 in stage 14.0 (TID 23)
org.apache.spark.sql.sedona_sql.expressions.InferredExpressionException: Exception occurred while evaluating expression ST_Transform - inputs: [MULTIPOLYGON (((-55.7735 -12.7529, -55.7735 -12.753, -55.7744 -12.753, -55.7976 -12.758, -55.7985 -12.758, -55.7985 -12.7578, -55.7994 -12.7578, -55.8022 -12.7585, -55.8027 -12.7602, -55.8024 -12.7602, -55.8028 -12.7611, -55.8028 -12.7613, -55.7981 -12.7601, -55.7981 -12.7601, -55.7962 -12.7601, -55.7962 -12.7598, -55.7956 -12.7598, -55.7956 -12.7595, -55.794 -12.7595, -55.794 -12.7593, -55.7919 -12.7593, -55.7919 -12.759, -55.7908 -12.759, -55.7908 -12.7587, -55.7886 -12.7587, -55.7886 -12.7585, -55.7875 -12.7585, -55.7875 -12.7582, -55.7859 -12.7582, -55.7859 -12.7579, -55.7851 -12.7579, -55.7851 -12.7577, -55.7844 -12.7577, -55.7842 -12.7572, -55.7794 -12.757, -55.7792 -12.757, -55.7745 -12.7554, -55.7726 -12.7552, -55.7735 -12.7529))), EPSG:4674, +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs], cause: Unknown projection: poly
sedona.sql("""select ST_Transform(geometry, 'EPSG:4674', 'PROJCS["SIRGAS 2000 / Brazil Polyconic",GEOGCS["SIRGAS 2000",DATUM["Sistema_de_Referencia_Geocentrico_para_las_AmericaS_2000",SPHEROID["GRS 1980",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4674"]],PROJECTION["Polyconic"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-54],PARAMETER["false_easting",5000000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","5880"]]') as geom_5880 from bronze_deter_cerrado""").show(1)
26/06/29 14:11:17 ERROR Executor: Exception in task 0.0 in stage 15.0 (TID 24)
org.apache.spark.sql.sedona_sql.expressions.InferredExpressionException: Exception occurred while evaluating expression ST_Transform - inputs: [MULTIPOLYGON (((-55.7735 -12.7529, -55.7735 -12.753, -55.7744 -12.753, -55.7976 -12.758, -55.7985 -12.758, -55.7985 -12.7578, -55.7994 -12.7578, -55.8022 -12.7585, -55.8027 -12.7602, -55.8024 -12.7602, -55.8028 -12.7611, -55.8028 -12.7613, -55.7981 -12.7601, -55.7981 -12.7601, -55.7962 -12.7601, -55.7962 -12.7598, -55.7956 -12.7598, -55.7956 -12.7595, -55.794 -12.7595, -55.794 -12.7593, -55.7919 -12.7593, -55.7919 -12.759, -55.7908 -12.759, -55.7908 -12.7587, -55.7886 -12.7587, -55.7886 -12.7585, -55.7875 -12.7585, -55.7875 -12.7582, -55.7859 -12.7582, -55.7859 -12.7579, -55.7851 -12.7579, -55.7851 -12.7577, -55.7844 -12.7577, -55.7842 -12.7572, -55.7794 -12.757, -55.7792 -12.757, -55.7745 -12.7554, -55.7726 -12.7552, -55.7735 -12.7529))), EPSG:4674, PROJCS["SIRGAS 2000 / Brazil Polyconic",GEOGCS["SIRGAS 2000",DATUM["Sistema_de_Referencia_Geocentrico_para_las_AmericaS_2000",SPHEROID["GRS 1980",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4674"]],PROJECTION["Polyconic"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-54],PARAMETER["false_easting",5000000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","5880"]]], cause: Unknown projection: Polyconic
This is Sedona 1.9.0. I've just pulled it from the docker hub.
I'm using the method "configure_spark_with_delta_pip" in the spark configuration to avoid handling the JARs regarding Delta Lake, etc.
Reported by our Discord user Sandro de Sena: https://discord.com/channels/1034906732264181760/1521160583682986165/1521160583682986165
Hey everyone, I'm hitting a roadblock when trying to reproject coordinates to a Polyconic projection (specifically EPSG:5880 / Brazil Polyconic).
I'm starting from EPSG:4674 and trying to transform to EPSG:5880. I've tried using the standard EPSG code, Proj4 strings, and OGC WKT definitions, but Sedona always fails with an InferredExpressionException.
Here is an example of what I tried:
sedona.sql("""
SELECT ST_Transform(
geometry,
'EPSG:4674',
'+proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +units=m +no_defs'
) as geom_5880
FROM bronze_deter_cerrado
""").show(1)
The underlying cause in the stack trace is always:
cause: Unknown projection: poly (or Unknown projection: Polyconic when using WKT/EPSG)
It seems the underlying GeoTools library isn't recognizing the American Polyconic projection math. Am I missing a specific config/dependency, or is this projection currently unsupported by Sedona's ST_Transform?
This is Sedona 1.9.0. I've just pulled it from the docker hub.
I'm using the method "configure_spark_with_delta_pip" in the spark configuration to avoid handling the JARs regarding Delta Lake, etc.
Am I doing something wrong?
Should I attach anything else so you can reproduce the error?
builder = (
SparkSession.builder
.appName("lakehouse-prototype")
.config("spark.sql.extensions",
"io.delta.sql.DeltaSparkSessionExtension,"
"org.apache.sedona.viz.sql.SedonaVizExtensions,"
"org.apache.sedona.sql.SedonaSqlExtensions")
.config("spark.sql.catalog.spark_catalog", "org.apache.spark.sql.delta.catalog.DeltaCatalog")
# Configurações do Object Storage (S3A)
.config("spark.hadoop.fs.s3a.endpoint", "http://rustfs:9000")
.config("spark.hadoop.fs.s3a.access.key", "rustfs_admin")
.config("spark.hadoop.fs.s3a.secret.key", "rustfs_secret")
.config("spark.hadoop.fs.s3a.path.style.access", "true")
.config("spark.hadoop.fs.s3a.impl", "org.apache.hadoop.fs.s3a.S3AFileSystem")
.config("spark.hadoop.fs.s3a.aws.credentials.provider", "org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider")
# Otimizações Delta
.config("spark.databricks.delta.optimizeWrite.enabled", "true")
.config("spark.databricks.delta.autoCompact.enabled", "true")
.config("spark.databricks.delta.properties.defaults.targetFileSize", "128mb")
# Otimizações gerais
.config("spark.sql.shuffle.partitions", "50")
.config("spark.sql.adaptive.enabled", "true")
.config("spark.sql.adaptive.coalescePartitions.enabled", "true")
)
spark = configure_spark_with_delta_pip(builder).getOrCreate()
spark.sparkContext.setLogLevel("ERROR")
sedona = SedonaContext.create(spark)