I am fairly new to python and seek guidance for a question which might sound trivial to many. Is there a way to use 'wget' in a python script to download raster files from a server and process them in the same script?
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
Python has urllib2 built-in, which opens a file-pointer-like object from a IP resource (HTTP, HTTPS, FTP).
You can then transfer and write the bytes locally (i.e., download it):
Now you can do whatever you want with the file. |
|||||
|
|
A couple of ways to accomplish this. You can use the subprocess module to call wget - see http://docs.python.org/library/subprocess.html
Or you can use python to download the file directly using the urllib (or urllib2) module - http://docs.python.org/library/urllib.html. There are examples in the documentation. |
|||
|
|
|
In this previous answer is a method using a call to os.system.
|
||||
|
|
