> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RS_FromPath

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

```sql theme={"system"}
RS_FromPath(path: String)
```

```sql theme={"system"}
RS_FromPath(path: String, params: String)
```

```sql theme={"system"}
RS_FromPath(path: String, params: String, eagerLoadMetadata: Boolean)
```

## Parameters

<ParamField body="path" type="String" required>
  The path to the raster image file.
</ParamField>

<ParamField body="params" type="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`.
</ParamField>

<ParamField body="eagerLoadMetadata" type="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.
</ParamField>

## Return type

<ResponseField type="Raster">
  The resulting out-db raster.
</ResponseField>

## Examples

### Load out-db rasters from path

```scala theme={"system"}
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

```scala theme={"system"}
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")
```
