Introduction: Returns an empty raster geometry. Every band in the raster is initialized to 0.0.
Return type: Raster
Since: v1.5.0
Format:
RS_MakeEmptyRaster(numBands: Integer, bandDataType: String = 'D', width: Integer, height: Integer, upperleftX: Double, upperleftY: Double, cellSize: Double)
It uses the default Cartesian coordinate system.
Format:
RS_MakeEmptyRaster(numBands: Integer, bandDataType: String = 'D', width: Integer, height: Integer, upperleftX: Double, upperleftY: Double, scaleX: Double, scaleY: Double, skewX: Double, skewY: Double, srid: Integer)
For more information about ScaleX, ScaleY, SkewX, SkewY, please refer to the Affine Transformations section.
!!!Note If any other value than the accepted values for the bandDataType is provided, RS_MakeEmptyRaster defaults to double as the data type for the raster.
Spark SQL example 1 (with 2 bands):
SELECT RS_MakeEmptyRaster(2, 10, 10, 0.0, 0.0, 1.0)
Output:
+--------------------------------------------+ |rs_makeemptyraster(2, 10, 10, 0.0, 0.0, 1.0)| +--------------------------------------------+ | GridCoverage2D["g...| +--------------------------------------------+
Spark SQL example 2 (with 2 bands and dataType):
SELECT RS_MakeEmptyRaster(2, 'I', 10, 10, 0.0, 0.0, 1.0) - Create a raster with integer datatype
Output:
+--------------------------------------------+ |rs_makeemptyraster(2, 10, 10, 0.0, 0.0, 1.0)| +--------------------------------------------+ | GridCoverage2D["g...| +--------------------------------------------+
Spark SQL example 3 (with 2 bands, scale, skew, and SRID):
SELECT RS_MakeEmptyRaster(2, 10, 10, 0.0, 0.0, 1.0, -1.0, 0.0, 0.0, 4326)
Output:
+------------------------------------------------------------------+ |rs_makeemptyraster(2, 10, 10, 0.0, 0.0, 1.0, -1.0, 0.0, 0.0, 4326)| +------------------------------------------------------------------+ | GridCoverage2D["g...| +------------------------------------------------------------------+
Spark SQL example 4 (with 2 bands, scale, skew, and SRID):
SELECT RS_MakeEmptyRaster(2, 'F', 10, 10, 0.0, 0.0, 1.0, -1.0, 0.0, 0.0, 4326) - Create a raster with float datatype
Output:
+------------------------------------------------------------------+ |rs_makeemptyraster(2, 10, 10, 0.0, 0.0, 1.0, -1.0, 0.0, 0.0, 4326)| +------------------------------------------------------------------+ | GridCoverage2D["g...| +------------------------------------------------------------------+