Overview

Note

  • Sedona uses 1-based indexing for all raster functions except map algebra function, which uses 0-based indexing.
  • Sedona by default enforces geographic coordinates to be in longitude/latitude order.
  • By default, all raster cell world coordinates correspond to the real world coordinates of the leftmost top corner of the cell.

Sedona SQL supports raster data sources and raster operators in DataFrame and SQL. Raster support is available in all Sedona language bindings including Scala, Java, Python and R.

myDataFrame = sedona.sql("YOUR_SQL")
myDataFrame.createOrReplaceTempView("rasterDf")
var myDataFrame = sedona.sql("YOUR_SQL")
myDataFrame.createOrReplaceTempView("rasterDf")
Dataset<Row> myDataFrame = sedona.sql("YOUR_SQL")
myDataFrame.createOrReplaceTempView("rasterDf")

In PySpark (the Python API for Apache Spark), when working with DataFrame operations, particularly in scenarios where you wish to execute SQL queries on a DataFrame, it is necessary to register this DataFrame as a temporary view or table. This step is crucial because PySpark, by default, doesn't recognize a DataFrame in SQL commands unless it is registered as a view.

The createOrReplaceTempView method registers the DataFrame as a temporary view with a specified name ("rasterDf"). This temporary view acts like a virtual table on which you can run SQL queries.

You can find example raster data in Sedona GitHub repo.


Last update: February 9, 2024 03:04:11