<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I'm very much enjoying the new feature in GDAL that gives programmatic access to the command-line tools. However, I've run into a problem using gdal.Warp from within Python.</div><div class=""><br class=""></div><div class="">In the example IPython session below, you can see that I try to run gdal.Warp and get an error, but using the equivalent parameters for the command-line (run with the ! at the beginning from within IPython), it works fine.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">In [<b class="">15</b>]: </span>gdal.Warp('data.vrt', 'robin2.tif', srcSRS = 'EPSG:4326', dstSRS = 'EPSG:27700', geoloc=True)</div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class=""><span style="color: rgb(195, 55, 32);" class="">---------------------------------------------------------------------------</span></div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">SystemError</span>                               Traceback (most recent call last)</div><div style="margin: 0px; font-size: 13px; font-family: Menlo; color: rgb(52, 189, 38);" class=""><ipython-input-15-279de83a9634><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> in </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class=""><module></span><span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">()</span></div><div style="margin: 0px; font-size: 13px; font-family: Menlo; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">----> 1</span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">gdal</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">Warp</span>('data.vrt',<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>'robin2.tif',<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> srcSRS </span>=<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>'EPSG:4326',<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> dstSRS </span>=<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>'EPSG:27700',<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> geoloc</span>=<span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">True</span>)</div><div style="margin: 0px; font-size: 13px; font-family: Menlo; min-height: 15px;" class=""><br class=""></div><div style="margin: 0px; font-size: 13px; font-family: Menlo; color: rgb(52, 189, 38);" class="">/Users/robin/anaconda3/lib/python3.5/site-packages/osgeo/gdal.py<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> in </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">Warp</span><span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">(destNameOrDestDS, srcDSOrSrcDSTab, **kwargs)</span></div><div style="margin: 0px; font-size: 13px; font-family: Menlo; color: rgb(52, 189, 38);" class=""><b class="">    547</b><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span></div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class=""><b class="">    548</b></span>     <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">if</span> _is_str_or_unicode<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">(</span>destNameOrDestDS<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">):</span></div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">--> 549</span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">         </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">return</span> wrapper_GDALWarpDestName<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">(</span>destNameOrDestDS<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">,</span> srcDSTab<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">,</span> opts<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">,</span> callback<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">,</span> callback_data<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">)</span></div><div style="margin: 0px; font-size: 13px; font-family: Menlo; color: rgb(52, 189, 38);" class=""><b class="">    550</b><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">     </span>else<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">:</span></div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class=""><b class="">    551</b></span>         <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">return</span> wrapper_GDALWarpDestDS<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">(</span>destNameOrDestDS<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">,</span> srcDSTab<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">,</span> opts<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">,</span> callback<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">,</span> callback_data<span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">)</span></div><div style="margin: 0px; font-size: 13px; font-family: Menlo; min-height: 15px;" class=""><br class=""></div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">SystemError</span>: <built-in function wrapper_GDALWarpDestName> returned NULL without setting an error</div><div style="margin: 0px; font-size: 13px; font-family: Menlo; min-height: 15px;" class=""><br class=""></div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #5330e1" class="">In [<b class="">16</b>]: </span>!gdalwarp data.vrt robin2.tif -geoloc -s_srs "EPSG:4326" -t_srs "EPSG:27700"</div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class="">Creating output file that is 1240P x 1162L.</div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class="">Processing input file data.vrt.</div><div style="margin: 0px; font-size: 13px; font-family: Menlo;" class="">0...10...20...30...40...50...60...70...80...90...100 - done.</div></div><div class=""><br class=""></div><div class="">Am I doing something wrong here in how I set the parameters for the gdal.Warp call?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">Robin</div><div class=""><br class=""></div><div class=""><div class="">Dr Robin Wilson</div><div class="">Research Fellow</div><div class="">University of Southampton, UK</div></div><div class=""><br class=""></div></body></html>