archivereader

Check if file within a zip archive and return apropriate GDAL path if so.

See GDAL documentation on reading files within a zip archive.

http://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip

tuiview.archivereader.file_list_to_archive_strings(filenames)[source]

Modifies any archive filenames in the list to allow them to be opened using a GDAL virtual filesystem.

Parameters:

filenames (list of str) – A list of filenames

Returns:

The list of filenames passed in, with any supported archive prepended with the appropriate string.

Return type:

list of str

tuiview.archivereader.gz_to_file(filepath)[source]

Converts a path ending in .gz so that it can be opened with GDAL

Parameters:

filepath (str) – Filepath ending in .gz

Returns:

Filepath prepended with gzip virtual filesystem string

Return type:

str

tuiview.archivereader.zip_to_file(filepath)[source]

Takes in a zip filepath and if the zip contains files that can be opened with GDAL then the filepath will be converted so that it can be opened without extraction.

Parameters:

filepath (str) – Filepath ending in .zip

Returns:

A list of files prepended with the zip virtual filesystem string

Return type:

list of str