From 9e8fe52c9b8b604798c28c95f1a9894ff5e8b3c1 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Thu, 12 Mar 2026 22:56:07 +1000 Subject: [PATCH] [CI] Configure EditorConfig for Scala Set indent style as spaces. Clean up code removing tabs from indentation --- .editorconfig | 3 ++ examples/spark-sql/src/main/scala/Main.scala | 2 +- .../spark-sql/src/main/scala/VizExample.scala | 34 +++++++++---------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.editorconfig b/.editorconfig index 4f21cb13f2a..cd2119f3004 100644 --- a/.editorconfig +++ b/.editorconfig @@ -32,6 +32,9 @@ trim_trailing_whitespace = true indent_size = 2 indent_style = space +[*.scala] +indent_style = space + [*.xml] indent_style = space diff --git a/examples/spark-sql/src/main/scala/Main.scala b/examples/spark-sql/src/main/scala/Main.scala index 45efd851652..2c59c7a7149 100644 --- a/examples/spark-sql/src/main/scala/Main.scala +++ b/examples/spark-sql/src/main/scala/Main.scala @@ -46,7 +46,7 @@ object Main extends App { SedonaVizRegistrator.registerAll(sedona) - val resourceFolder = System.getProperty("user.dir")+"/src/test/resources/" + val resourceFolder = System.getProperty("user.dir")+"/src/test/resources/" // SQL-based spatial operations println("=== Running SQL Examples ===") diff --git a/examples/spark-sql/src/main/scala/VizExample.scala b/examples/spark-sql/src/main/scala/VizExample.scala index 1108f4a09da..b1d4c65ff99 100644 --- a/examples/spark-sql/src/main/scala/VizExample.scala +++ b/examples/spark-sql/src/main/scala/VizExample.scala @@ -136,32 +136,32 @@ object VizExample { .filter("ST_Contains(ST_PolygonFromEnvelope(-126.790180,24.863836,-64.630926,50.000),shape)").createOrReplaceTempView("pointtable") sedona.sql( """ - |CREATE OR REPLACE TEMP VIEW pixels AS - |SELECT pixel, shape FROM pointtable - |LATERAL VIEW Explode(ST_Pixelize(shape, 256, 256, ST_PolygonFromEnvelope(-126.790180,24.863836,-64.630926,50.000))) AS pixel - """.stripMargin) + |CREATE OR REPLACE TEMP VIEW pixels AS + |SELECT pixel, shape FROM pointtable + |LATERAL VIEW Explode(ST_Pixelize(shape, 256, 256, ST_PolygonFromEnvelope(-126.790180,24.863836,-64.630926,50.000))) AS pixel + """.stripMargin) sedona.sql( """ - |CREATE OR REPLACE TEMP VIEW pixelaggregates AS - |SELECT pixel, count(*) as weight - |FROM pixels - |GROUP BY pixel - """.stripMargin) + |CREATE OR REPLACE TEMP VIEW pixelaggregates AS + |SELECT pixel, count(*) as weight + |FROM pixels + |GROUP BY pixel + """.stripMargin) sedona.sql( """ - |CREATE OR REPLACE TEMP VIEW images AS - |SELECT ST_Render(pixel, ST_Colorize(weight, (SELECT max(weight) FROM pixelaggregates), 'red')) AS image - |FROM pixelaggregates - """.stripMargin) + |CREATE OR REPLACE TEMP VIEW images AS + |SELECT ST_Render(pixel, ST_Colorize(weight, (SELECT max(weight) FROM pixelaggregates), 'red')) AS image + |FROM pixelaggregates + """.stripMargin) val image = sedona.table("images").take(1)(0)(0).asInstanceOf[ImageSerializableWrapper].getImage val imageGenerator = new ImageGenerator imageGenerator.SaveRasterImageAsLocalFile(image, sqlApiOutputPath, ImageType.PNG) sedona.sql( """ - |CREATE OR REPLACE TEMP VIEW imagestring AS - |SELECT ST_EncodeImage(image) - |FROM images - """.stripMargin) + |CREATE OR REPLACE TEMP VIEW imagestring AS + |SELECT ST_EncodeImage(image) + |FROM images + """.stripMargin) sedona.table("imagestring").show() }