Skip to main content
Returns an out-db raster from a path to an image file. Out-db rasters hold references to raster files instead of holding the actual pixel data. Out-db rasters can be used interchangeably with ordinary rasters. The only difference is that out-db rasters will load raster files in a deferred manner. Pixel data won’t be loaded until pixel values are accessed by functions such as RS_Value or RS_BandAsArray. It is more appropriate to load large raster files as out-db rasters. 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. To load GeoTiff files without automatic rescaling, please add raster.reader.auto-rescale=false to the parameters.

Signatures

RS_FromPath(path: String)
RS_FromPath(path: String, params: String)
RS_FromPath(path: String, params: String, eagerLoadMetadata: Boolean)

Parameters

path
String
required
The path to the raster image file.
params
String
A ; delimited string of additional parameters for configuring the Hadoop file system. For example, fs.s3a.access.key=xxx;fs.s3a.secret.key=xxx.
eagerLoadMetadata
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.

Examples

Load out-db rasters from path

var df = sedona.read.format("binaryFile").load("/some/path/*.tiff")
df = df.selectExpr("path", "RS_FromPath(path) as rast")

Load out-db rasters with custom Hadoop file system parameters

var df = sedona.read.format("binaryFile").load("/some/path/*.tiff")
df = df.selectExpr("path", "RS_FromPath(path, 'fs.s3a.access.key=xxx;fs.s3a.secret.key=xxx') as rast")