[gdal-dev] Problem calling gdalwarp from within python script

Pietro Zambelli peter.zamb at gmail.com
Mon Jan 20 01:40:17 PST 2014


On Sunday 19 Jan 2014 14:27:49 Simon Proud wrote:
> Hi,
> I wish to call gdalwarp from within a python script but I cannot get
> it to work.
> 
> The command I wish to run is:
> 
> gdalwarp -q -multi -r cubicspline -t_srs '+proj=geos +lon_0=0.0
> +h=35785831' -te -5568748.2758 -5568748.4774 5568748.2758
> 5568748.2758 -tr 3000.40316582 3000.40316582 -srcnodata 65535
> TEST.tiff TEST2.tiff

You can run the command directly with:

{{{
cmd = "gdalwarp -q -multi -r cubicspline -t_srs '+proj=geos +lon_0=0.0
 +h=35785831' -te -5568748.2758 -5568748.4774 5568748.2758
 5568748.2758 -tr 3000.40316582 3000.40316582 -srcnodata 65535
 TEST.tiff TEST2.tiff"

Subprocess.Popen(cmd, shell=True)
}}}

See the doc: 
http://docs.python.org/2/library/subprocess.html#using-the-subprocess-module

Pietro


More information about the gdal-dev mailing list