[Qgis-user] QGIS3: ogr2ogr canceling impossible

Tobias Wendorff tobias.wendorff at tu-dortmund.de
Tue Apr 3 09:21:08 PDT 2018


Am Di, 3.04.2018, 05:38 schrieb Nyall Dawson:
>
> What script did you use to add cancelation support?

Using powershell, the easiest way:
Stop-Process -name ogr2ogr

This might kill processes, the user has started outside of QGIS3.
So we need something more complex:

Get-WmiObject Win32_Process -Filter "name = 'ogr2ogr.exe'" | Select-Object
CommandLine

This will show the parameters, ogr2ogr was started with. You can run
a filter on it with the current temporary filename and kill this
process by piping it to "Stop-Process".

The best way would be (in Linux and Windows) to start the process
using C++ or Python's subprocess, get the PID of the started process
and kill it, when pressing "cancel".




More information about the Qgis-user mailing list