Advanced Datasets

The analogy of Python file objects influences the design of Rasterio dataset objects. Datasets of a few different kinds exist and the canonical way to obtain one is to call with a path-like object or URI-like identifier, a mode (such as “r” or “w”), and other keyword arguments.

Dataset Identifiers

Datasets in a computer’s filesystem are identified by paths, “file” URLs, or instances of pathlib.Path. The following are equivalent.

  • '/path/to/file.tif'

  • 'file:///path/to/file.tif'

  • pathlib.Path('/path/to/file.tif')

Datasets within a local zip file are identified using the “zip” scheme from Apache Commons VFS.

  • 'zip:///path/to/!/folder/file.tif'

  • 'zip+file:///path/to/!/folder/file.tif'

Note that ! is the separator between the path of the archive file and the path within the archive file. Also note that his kind of identifier can’t be expressed using pathlib.

Similarly, variables of a netCDF dataset can be accessed using “netcdf” scheme identifiers.


Datasets on the web are identifed by “http” or “https” URLs such as

  • ''

  • ''

Datasets within a zip file on the web are identified using a “zip+https” scheme and paths separated by ! as above. For example:


Datasets on AWS S3 may be identified using “s3” scheme identifiers.


Resources in other cloud storage systems will be similarly supported.