rog33zy opened a new issue, #1827:
URL: https://github.com/apache/sedona/issues/1827
### Description:
I am using Apache Sedona with Sparklyr in R to visualize a GeoParquet file,
but I am encountering an error when trying to render a choropleth map using
**sedona_render_choropleth_map()**.
### Error Message:
> ! java.lang.Exception: No matched method found for class
>
org.apache.sedona.viz.extension.visualizationEffect.ChoroplethMap.Visualize
### Environment Details:
- Operating System: Docker rocker/rstudio:4.4.1 image running Ubuntu
- Apache Sedona Version: 1.7.0 (for sedona-spark-shaded) and 1.4.1 (for
sedona-viz)
- Spark Version: 3.5.4
- Sparklyr Version: 1.8.6
- R Version: 4.4.1
### Reproducible Code:
```
library(sparklyr)
library(apache.sedona)
partitions_to_use <- parallel::detectCores() * 3
spark_dir = file.path(getwd(), "data", "spark")
config <- spark_config()
config$`sparklyr.shell.driver-java-options` <- paste0("-Djava.io.tmpdir=",
spark_dir)
config$`sparklyr.shell.driver-memory` <- '6G'
config$`sparklyr.shell.executor-memory` <- "6G"
config$`spark.executor.memoryOverhead` <- "2512"
config$spark.sql.shuffle.partitions.local <- partitions_to_use
config$spark.driver.extraJavaOptions <- "-Xmx4G"
Sys.setenv(
"SEDONA_JAR_FILES" =
"/opt/spark/jars/sedona-spark-shaded-3.5_2.12-1.7.0.jar:/opt/spark/jars/sedona-viz-3.4_2.12-1.4.1.jar"
)
options(sparklyr.log.console = F)
sc <- spark_connect(master = "local[*]", config = config)
resolution_x <- 1000
resolution_y <- 600
boundary <- c(-74.25909, -73.70018, 40.477399, 40.917577)
df <- spark_read_geoparquet(
sc,
name = "fulldata",
path = file.path(getwd(), "data", "geoparquets2",
"part-0004.snappy.parquet")
)
sdf_schema(df)
polygon_rdd <- to_spatial_rdd(
df |> select(pickup_geomety),
spatial_col = "pickup_geomety"
)
polygon_df <- sdf_register(polygon_rdd) |> mutate(value = 1L)
polygon_pair_rdd <- to_spatial_rdd(
polygon_df,
"geometry"
)
base_map_file <- "./base-map"
sedona_render_choropleth_map(
pair_rdd = polygon_pair_rdd,
resolution_x = resolution_x,
resolution_y = resolution_y,
output_location = base_map_file,
boundary = boundary,
color_of_variation = "green",
base_color = c(255,255,255)
)
```
### What I have Tried:
- Verified that the JAR files are correctly loaded into Spark.
- Checked that the spatial RDDs are correctly created.
- Ensured that the pickup_geomety and geometry columns exist in the dataset.
Would appreciate any guidance on resolving this issue! Thanks in advance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]