In ArcGIS, I want to use a Python script (and a standard ArcGIS script tool UI) to call functionality from FWTools.
How would I make the call to FWTools? I tried using os.system(C:\WINDOWS\system32\cmd.exe /K "C:\Program Files\FWTools2.4.7\setfw.bat") which is what the windows shortcut calls, but that is not it. It seems I am probably missing something rather simple, but I can't figure out how to make the right call through python to get FWTools & ogr2ogr operating on the string I pass.
My UI looks like this:
and the pseudo-code behind it is something like:
'ogr2ogr -f "' + outformat + '" "' + outfile + '" "' + infile + '" ' + ogrvars