To load GeoTIFF and Arc Info ASCII Grid (
.asc) files, use the raster data source, sedona.read.format("raster").load(path), in place of RS_FromPath. The data source splits each file into tiles as it reads it, loads the raster metadata in parallel, and spreads the tiles across the cluster. RS_FromPath returns one untiled raster for each path.RS_Value or RS_BandAsArray.
Currently supports loading GeoTiff files (*.tiff or *.tif) and Arc Info Ascii Grid files (*.asc).
Additional parameters for configuring the Hadoop file system can be passed in as a ; delimited string. For example, fs.s3a.access.key=xxx;fs.s3a.secret.key=xxx. The same string also carries reader settings such as raster.reader.auto-rescale=false, described in Band values, scale, and offset.
Band values, scale, and offset
RS_FromPath applies the per-band scale and offset stored in a GeoTIFF’s GDAL metadata by default (raster.reader.auto-rescale defaults to true), so the pixel functions return physical units rather than the raw digital numbers (DNs) stored in the file. This differs from the raster data source, which keeps the raw DNs unless its autoRescale option is enabled. See Band values, scale, and offset for what rescaling changes.
Pass raster.reader.auto-rescale=false in the params string to keep the raw DNs and the file’s native pixel type:
spark.hadoop.raster.reader.auto-rescale=false when the session is created. It then applies to every RS_FromPath call that does not override it in params.
Signatures
Parameters
String
required
The path to the raster image file.
String
A
; delimited string of additional parameters for configuring the Hadoop file system and the reader. For example, fs.s3a.access.key=xxx;fs.s3a.secret.key=xxx, or raster.reader.auto-rescale=false to keep raw digital numbers (see Band values, scale, and offset).Boolean
default:"false"
If set to
true, the metadata of the raster file will be loaded immediately and any errors encountered reading the raster file will be reported. If false, only the path to the raster file is kept without loading it, until the metadata is actually needed.Return type
The resulting out-db raster.

