Downloading and Extracting LIDAR ZIP Files from PASDA (Python Script)
Summary: These instructions use a combination of 1) Google Chrome Batch Link Downloader Extension and 2) a python
script to make downloading and extracting a large number of LIDAR data (zip files) from the PASDA FTP site
([Link] fast and easy.
System Requirements: Python 2.7
Author: John Smoluk
PA DCNR, Bureau of Forestry, Forest Information & Spatial Analysis Section
jsmoluk@[Link]
717-425-7552
Disclaimer: Users are advised to use these instructions strictly at their own risk. No warranties are made about the reliability or
security of these instructions. No parties shall be held liable for any losses or damages of any kind in connection with the use of
these instructions.
INSTRUCTIONS:
1. Copy the included python script at the bottom of this PDF and paste it into a blank Notepad document and save it as
a ‘.py’ file (ex: [Link]) somewhere on your local computer (ex: C:\Scripts)
2. Install the “batch-link-downloader” (Google Chrome extension) to facilitate easy downloading of LiDAR (zip) files:
a. [Link]
3. Add the extension to chrome, you will now have this icon in the upper right corner:
4. Navigate to the page where all the zip files are listed for download (ex:
[Link] )
5. Click on the batch link downloader icon, select the LiDAR zip files that you want, then click the Start Download
button:

6. The zip files will be downloaded into your “Downloads” folder on your C-Drive. Move these zip files into a new folder
so they are the only zip files in that directory. The python script will extract the contents of ANY zip file in the
directory and remove/delete the original zip files after extracting. Therefore, make sure there are no other files in
the directory that you’ve moved the LiDAR zip files into.
7. Right click the saved ‘.py’ file you created in step 1 and open it for editing in Notepad, Python IDE, or another IDE of
your choosing.
Change the “dir_name” path to the directory where your zip files are located:
Change the “new_dir” path to the directory where you want the zip files extracted to:
Save and then close the script.
8. Run the ‘.py’ file you just edited in [Link] (both 32 or 64 bit should work). The black python window appears
and automatically closes when the script is finished. The contents of the zip files should now be extracted in the
folder you specified, and the original zip files deleted. It may take several hours to complete if you are downloading
a large amount of LiDAR data for a large area.
The script:
import os, zipfile
dir_name = r"C:\Users\username\folder\folder" # folder where zip files are located
new_dir = r"\\servername\folder\folder" # folder where extracted files will go
extension = ".zip"
for item in [Link](dir_name):
if [Link](extension):
file_name = [Link](item)
zip_ref = [Link](file_name)
zip_ref.extractall(new_dir)
zip_ref.close()
[Link](file_name)