filmov
tv
Using Python in GIS: Extracting a Tar File
Показать описание
This video explores how to create a script to extract (unzip) a Tar file and create a Folder tree to hold our Landsat images and folders for future analysis.
The previous videos in the series are useful knowledge for topics in this video.
Twitter: @my_physical
Instagram: @MyPhysicalWorld
Code used in this video:
import os
import tarfile
import arcpy
# ------------------------------------------------Variable definitions
imgZipDir = r"D:\GISData\LandsatZips"
imgMain = r"D:\GISProgramming\Landsat"
imgFRoot = imgFile[0:40] + '_'
imgFDate = imgFile[17:25]
imgPathrow = imgFile[10:16]
# ----------------------------------------------Create Satellite Image Directory Tree
try:
except OSError:
print("Creation of the Folder %s failed" % imgFDate)
else:
print("New Folder %s has been created." % imgFDate)
print(imgFRoot + " Has been extracted...")
# ---------------------------------------------- Process the image Metafile
The previous videos in the series are useful knowledge for topics in this video.
Twitter: @my_physical
Instagram: @MyPhysicalWorld
Code used in this video:
import os
import tarfile
import arcpy
# ------------------------------------------------Variable definitions
imgZipDir = r"D:\GISData\LandsatZips"
imgMain = r"D:\GISProgramming\Landsat"
imgFRoot = imgFile[0:40] + '_'
imgFDate = imgFile[17:25]
imgPathrow = imgFile[10:16]
# ----------------------------------------------Create Satellite Image Directory Tree
try:
except OSError:
print("Creation of the Folder %s failed" % imgFDate)
else:
print("New Folder %s has been created." % imgFDate)
print(imgFRoot + " Has been extracted...")
# ---------------------------------------------- Process the image Metafile