New answers tagged batch
In the Osgeo4w shell that comes with QGIS, you can run this batch file on Windows: for %%N in (D:\Karten\gpx\Topo\*.gpx) DO ogr2ogr -t_srs epsg:4326 D:\Karten\gpx\Topo\%%~nN-wp.shp %%N waypoints for %%N in (D:\Karten\gpx\Topo\*.gpx) DO ogr2ogr -t_srs epsg:4326 D:\Karten\gpx\Topo\%%~nN-rt.shp %%N routes for %%N in (D:\Karten\gpx\Topo\*.gpx) DO ogr2ogr -t_srs ...
You could use the following code in your Python console. Load the .gpx file into QGIS and change the result_path to your desired location: import processing result_path = "C:/Users/You/Desktop/Test/Results//" for layer in QgsMapLayerRegistry.instance().mapLayers().values(): processing.runalg("gdalogr:convertformat", layer, 0, '', result_path + ...
for a single tool, you could also right-click on "zonal stat as table" and run it in batch. Concerning your code, if it runs without errors nor results, you should first check the layer being processed ("print raster"in the loop), then make sure that there is no projection issue.
The fourth parameter to ZonalStatisticsAsTable should be the output name - since you've put "DATA" there (which should be parameter 5), you're likely getting no output. You'll need to put your destination_path variable in that location. But I'll also caution you that, as written, destination_path is going to keep growing since you're appending to it in each ...
Use LizardTech's (free) GeoViewer's Tools->Export. It is an order of magnitude faster than gdal_dtranslate. Although this is not a batch process, I did find dlls in the directory where the .exe is located that may enable writing your own export utility.
One way would be to export all metadata using ExportMetadata_conversion, and then manipulate (find and replace the text) the exported XMLs and then reimport them using ImportMetadata_conversion
With some help from @elrobis I tracked down the cause of the problem and a simple solution. If you have a percent sign (%) in the batch file (as a result of URL Encoding non alphanumeric characters) it is interpreted as a variable name - see this oldy but goody of an article. Since the variable replacements are happening before the batch file is executed, ...
It should work this way: Start the OSGEO4W shell Change the folder with cd to the folder where your batch file is, or copy the batch into the folder where the shell lands Run the batch inside the shell by manually typing filename.bat You don't need to care for PATH variables, this is done when starting the OSGEO4W shell.
I think this might solve your problem: To set up the o4w environment, add this to the start of your bat file: Call C:\OSGeo4W\bin\o4w_env.bat Run all the lines from the text file there.
Top 50 recent answers are included