Functions That Read and Write Files in Compressed Formats

Geospatial data, like other files, are frequently stored and transmitted in compressed or archive formats, such a tar, zip, or GNU zip. Several MATLAB® functions read or write such files. All create files in a folder for which you must have write permission. Input files can exist on your host computer, reside on a local area network, or be located on the Internet (in which case they are identified using URLs).

The following table identifies MATLAB functions that you can use to read, uncompress, compress, and write archived data files, geospatial or otherwise. Click any link to read the function's documentation.

Function

Purpose

gunzip

Uncompress files in the GNU zip format

untar

Extract the contents of a tar file

unzip

Extract the contents of a zip file

gzip

Compress files into the GNU zip format

tar

Compress files into a tar file

zip

Compress files into a zip file

Use the functions gunzip, untar, and unzip to read data files specified with a URL or with path syntax. Use the functions gzip, tar, and zip to create your own compressed files and archives. This capability is useful, for example, for packaging a set of shapefiles, or a world file along with the data grid or image it describes, for distribution.