-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Programming ArcGIS with Python Cookbook, Second Edition
By :
Retrieving files from an FTP server for processing is a very common operation for GIS programmers and can be automated with a Python script.
Connecting to an FTP server and downloading a file is accomplished through the ftplib module. A connection to an FTP server is created through the FTP object, which accepts a host, username, and password to create the connection. Once a connection has been opened, you can then search for and download files.
In this recipe, you will connect to the National Interagency Fire Center Incident FTP site and download a PDF file for a wildfire in Colorado. Before you run the following script, you will need to create a username/password through http://gis.nwcg.gov/data_nifcftp.html.
Follow these steps to create a script that connects to an FTP server and downloads a file:
C:\ArcpyBook\Appendix2\ftp.py.
Change the font size
Change margin width
Change background colour