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.




Uncompress files in the GNU zip format


Extract the contents of a tar file


Extract the contents of a zip file


Compress files into the GNU zip format


Compress files into a tar file


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.