Hi Everyone,
I am trying to read a geojson file in Databricks using the following syntax as mentioned in the apache sedona official docs Load Geojson Data
I am using Sedon 1.6.1 Version which supports this feature but i am getting an error as mentioned below
df = sedona.read.format("geojson").option("multiLine", "true").load("PATH/TO/MYFILE.json") .selectExpr("explode(features) as features") # Explode the envelope to get one feature per row. .select("features.*") # Unpack the features struct. .withColumn("prop0", f.expr("properties['prop0']")).drop("properties").drop("type")
Error :
Caused by: java.lang.NoSuchMethodError: org.apache.spark.sql.execution.datasources.json.JsonDataSource.readFile(Lorg/apache/hadoop/conf/Configuration;Lorg/apache/spark/sql/execution/datasources/PartitionedFile;Lorg/apache/spark/sql/catalyst/json/JacksonParser;Lorg/apache/spark/sql/types/StructType;)Lscala/collection/Iterator;
I am using the following Jars and Libraries as mentioned below
I have installed the following libraries
- apache-sedona==1.6.1
- geopandas==0.11.1
- keplergl==0.3.2
- pydeck==0.8.0
Kindly assist me as to how can i fix this. For now i am using spark context to read the geojson file and it is working but i want to use the feature of sedona since it will reduce the number of steps to extract the Polygon Coordinates.